mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Allow editing group wallpaper / status / emoji set.
This commit is contained in:
@@ -1163,20 +1163,34 @@ void ApplyChannelUpdate(
|
||||
channel->owner().botCommandsChanged(channel);
|
||||
}
|
||||
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.id;
|
||||
const auto sset = stickerSet ? &stickerSet->c_stickerSet() : nullptr;
|
||||
const auto newStickerSetId = (sset ? sset->vid().v : 0);
|
||||
const auto oldStickerSetId = channel->mgInfo->stickerSet.id;
|
||||
const auto stickersChanged = (canEditStickers != channel->canEditStickers())
|
||||
|| (oldSetId != newSetId);
|
||||
if (oldSetId != newSetId) {
|
||||
|| (oldStickerSetId != newStickerSetId);
|
||||
if (oldStickerSetId != newStickerSetId) {
|
||||
channel->mgInfo->stickerSet = StickerSetIdentifier{
|
||||
.id = set ? set->vid().v : 0,
|
||||
.accessHash = set ? set->vaccess_hash().v : 0,
|
||||
.id = sset ? sset->vid().v : 0,
|
||||
.accessHash = sset ? sset->vaccess_hash().v : 0,
|
||||
};
|
||||
}
|
||||
if (stickersChanged) {
|
||||
session->changes().peerUpdated(channel, UpdateFlag::StickersSet);
|
||||
}
|
||||
const auto emojiSet = update.vemojiset();
|
||||
const auto eset = emojiSet ? &emojiSet->c_stickerSet() : nullptr;
|
||||
const auto newEmojiSetId = (eset ? eset->vid().v : 0);
|
||||
const auto oldEmojiSetId = channel->mgInfo->emojiSet.id;
|
||||
const auto emojiChanged = (oldEmojiSetId != newEmojiSetId);
|
||||
if (oldEmojiSetId != newEmojiSetId) {
|
||||
channel->mgInfo->emojiSet = StickerSetIdentifier{
|
||||
.id = eset ? eset->vid().v : 0,
|
||||
.accessHash = eset ? eset->vaccess_hash().v : 0,
|
||||
};
|
||||
}
|
||||
if (emojiChanged) {
|
||||
session->changes().peerUpdated(channel, UpdateFlag::EmojiSet);
|
||||
}
|
||||
channel->setBoostsUnrestrict(
|
||||
update.vboosts_applied().value_or_empty(),
|
||||
update.vboosts_unrestrict().value_or_empty());
|
||||
|
Reference in New Issue
Block a user