mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
removing new added stickers from custom
This commit is contained in:
@@ -83,7 +83,19 @@ bool StickerSetInner::failedSet(const RPCError &error) {
|
||||
|
||||
void StickerSetInner::installDone(const MTPBool &result) {
|
||||
StickerSets &sets(cRefStickerSets());
|
||||
StickerSets::iterator custom = sets.find(CustomStickerSetId);
|
||||
sets.insert(_setId, StickerSet(_setId, _setAccess, _setTitle, _setShortName)).value().stickers = _pack;
|
||||
if (custom != sets.cend()) {
|
||||
for (int32 i = 0, l = _pack.size(); i < l; ++i) {
|
||||
int32 index = custom->stickers.indexOf(_pack.at(i));
|
||||
if (index >= 0) {
|
||||
custom->stickers.removeAt(index);
|
||||
}
|
||||
}
|
||||
if (custom->stickers.isEmpty()) {
|
||||
sets.erase(custom);
|
||||
}
|
||||
}
|
||||
cSetStickersHash(QByteArray());
|
||||
Local::writeStickers();
|
||||
emit installed(_setId);
|
||||
|
||||
Reference in New Issue
Block a user