mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
removing new added stickers from custom
This commit is contained in:
parent
147eaab59a
commit
725fa87188
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue