2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Don't store MTPInputStickerSet in data.

This commit is contained in:
John Preston
2021-07-08 19:42:57 +03:00
parent 9dfb43d525
commit 75090dedaa
23 changed files with 152 additions and 119 deletions

View File

@@ -868,15 +868,14 @@ void ApplyChannelUpdate(
const auto stickerSet = update.vstickerset();
const auto set = stickerSet ? &stickerSet->c_stickerSet() : nullptr;
const auto newSetId = (set ? set->vid().v : 0);
const auto oldSetId = (channel->mgInfo->stickerSet.type() == mtpc_inputStickerSetID)
? channel->mgInfo->stickerSet.c_inputStickerSetID().vid().v
: 0;
const auto oldSetId = channel->mgInfo->stickerSet.id;
const auto stickersChanged = (canEditStickers != channel->canEditStickers())
|| (oldSetId != newSetId);
if (oldSetId != newSetId) {
channel->mgInfo->stickerSet = set
? MTP_inputStickerSetID(set->vid(), set->vaccess_hash())
: MTP_inputStickerSetEmpty();
channel->mgInfo->stickerSet = StickerSetIdentifier{
.id = set ? set->vid().v : 0,
.accessHash = set ? set->vaccess_hash().v : 0,
};
}
if (stickersChanged) {
session->changes().peerUpdated(channel, UpdateFlag::StickersSet);