2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Writing installed, featured, recent and archived stickers separately.

This commit is contained in:
John Preston
2016-07-21 13:09:47 +03:00
parent b35c99cb0c
commit 81850b78c7
9 changed files with 423 additions and 254 deletions

View File

@@ -1734,8 +1734,20 @@ namespace {
App::main()->incrementSticker(result);
}
if (versionChanged) {
if (result->sticker()) {
Local::writeStickers();
if (result->sticker() && result->sticker()->set.type() == mtpc_inputStickerSetID) {
auto it = Global::StickerSets().constFind(result->sticker()->set.c_inputStickerSetID().vid.v);
if (it != Global::StickerSets().cend()) {
if (it->id == Stickers::CloudRecentSetId) {
Local::writeRecentStickers();
} else if (it->flags & MTPDstickerSet::Flag::f_archived) {
Local::writeArchivedStickers();
} else if (it->flags & MTPDstickerSet::Flag::f_installed) {
Local::writeInstalledStickers();
}
if (it->flags & MTPDstickerSet_ClientFlag::f_featured) {
Local::writeFeaturedStickers();
}
}
}
auto &items = App::documentItems();
auto i = items.constFind(result);