2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

sticker packs done

This commit is contained in:
John Preston
2015-05-19 18:46:45 +03:00
parent 136fd5c8e1
commit 92858dc7d3
39 changed files with 2312 additions and 702 deletions

View File

@@ -89,12 +89,15 @@ RecentEmojiPack gRecentEmojis;
RecentEmojisPreload gRecentEmojisPreload;
EmojiColorVariants gEmojiVariants;
AllStickers gStickers;
QByteArray gStickersHash;
EmojiStickersMap gEmojiStickers;
RecentStickerPreload gRecentStickersPreload;
RecentStickerPack gRecentStickers;
StickerSets gStickerSets;
uint64 gLastStickersUpdate = 0;
RecentHashtagPack gRecentWriteHashtags, gRecentSearchHashtags;
@@ -249,7 +252,7 @@ RecentEmojiPack &cGetRecentEmojis() {
0xD83DDE15LLU,
};
for (int32 i = 0, s = sizeof(defaultRecent) / sizeof(defaultRecent[0]); i < s; ++i) {
if (r.size() >= EmojiPadPerRow * EmojiPadRowsPerPage) break;
if (r.size() >= EmojiPanPerRow * EmojiPanRowsPerPage) break;
EmojiPtr ep(emojiGet(defaultRecent[i]));
if (!ep || ep == TwoSymbolEmoji) continue;
@@ -268,3 +271,20 @@ RecentEmojiPack &cGetRecentEmojis() {
}
return cRefRecentEmojis();
}
RecentStickerPack &cGetRecentStickers() {
if (cRecentStickers().isEmpty() && !cRecentStickersPreload().isEmpty()) {
RecentStickerPreload p(cRecentStickersPreload());
cSetRecentStickersPreload(RecentStickerPreload());
RecentStickerPack &recent(cRefRecentStickers());
recent.reserve(p.size());
for (RecentStickerPreload::const_iterator i = p.cbegin(), e = p.cend(); i != e; ++i) {
DocumentData *doc = App::document(i->first);
if (!doc || !doc->sticker) continue;
recent.push_back(qMakePair(doc, i->second));
}
}
return cRefRecentStickers();
}