2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Update API scheme on layer 144.

This commit is contained in:
John Preston
2022-07-08 21:04:31 +04:00
parent 6e25a2fc12
commit afc7b1da62
16 changed files with 229 additions and 71 deletions

View File

@@ -2298,6 +2298,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
case mtpc_updateStickerSetsOrder: {
auto &d = update.c_updateStickerSetsOrder();
auto &stickers = session().data().stickers();
const auto isEmoji = d.is_emojis();
const auto isMasks = d.is_masks();
const auto &order = d.vorder().v;
const auto &sets = stickers.sets();
@@ -2308,11 +2309,16 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
result.push_back(item.v);
}
const auto localSize = isMasks
const auto localSize = isEmoji
? stickers.emojiSetsOrder().size()
: isMasks
? stickers.maskSetsOrder().size()
: stickers.setsOrder().size();
if ((result.size() != localSize) || (result.size() != order.size())) {
if (isMasks) {
if (isEmoji) {
stickers.setLastEmojiUpdate(0);
session().api().updateCustomEmoji();
} else if (isMasks) {
stickers.setLastMasksUpdate(0);
session().api().updateMasks();
} else {
@@ -2320,7 +2326,10 @@ void Updates::feedUpdate(const MTPUpdate &update) {
session().api().updateStickers();
}
} else {
if (isMasks) {
if (isEmoji) {
stickers.emojiSetsOrderRef() = std::move(result);
session().local().writeInstalledCustomEmoji();
} else if (isMasks) {
stickers.maskSetsOrderRef() = std::move(result);
session().local().writeInstalledMasks();
} else {