2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Update API scheme on layer 145.

This commit is contained in:
John Preston
2022-09-01 09:58:04 +04:00
parent e0513f7b7c
commit 0a3077b9a5
6 changed files with 122 additions and 18 deletions

View File

@@ -2345,6 +2345,36 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updateMoveStickerSetToTop: {
const auto &d = update.c_updateMoveStickerSetToTop();
auto &stickers = session().data().stickers();
const auto isEmoji = d.is_emojis();
const auto setId = d.vstickerset().v;
auto &order = isEmoji
? stickers.emojiSetsOrderRef()
: stickers.setsOrderRef();
const auto i = ranges::find(order, setId);
if (i == order.end()) {
if (isEmoji) {
stickers.setLastEmojiUpdate(0);
session().api().updateCustomEmoji();
} else {
stickers.setLastUpdate(0);
session().api().updateStickers();
}
} else if (i != order.begin()) {
std::rotate(order.begin(), i, i + 1);
if (isEmoji) {
session().local().writeInstalledCustomEmoji();
} else {
session().local().writeInstalledStickers();
}
stickers.notifyUpdated(isEmoji
? Data::StickersType::Emoji
: Data::StickersType::Stickers);
}
} break;
case mtpc_updateStickerSets: {
const auto &d = update.c_updateStickerSets();
if (d.is_emojis()) {