2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

sticker packs management done, conversations list context menu added

This commit is contained in:
John Preston
2015-12-02 20:17:53 +03:00
parent 2c95fa5e15
commit ed3601f883
27 changed files with 1773 additions and 278 deletions

View File

@@ -323,3 +323,24 @@ namespace Notify {
void migrateUpdated(PeerData *peer);
};
inline int32 stickersCountHash(bool checkOfficial = false) {
uint32 acc = 0;
bool foundOfficial = false, foundBad = false;;
const StickerSets &sets(cStickerSets());
const StickerSetsOrder &order(cStickerSetsOrder());
for (StickerSetsOrder::const_iterator i = order.cbegin(), e = order.cend(); i != e; ++i) {
StickerSets::const_iterator j = sets.constFind(*i);
if (j != sets.cend()) {
if (j->id == 0) {
foundBad = true;
} else if (j->flags & MTPDstickerSet::flag_official) {
foundOfficial = true;
}
if (!(j->flags & MTPDstickerSet::flag_disabled)) {
acc = (acc * 20261) + j->hash;
}
}
}
return (!checkOfficial || (!foundBad && foundOfficial)) ? int32(acc & 0x7FFFFFFF) : 0;
}