2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Added support for archived masks.

This commit is contained in:
23rd
2021-03-30 18:51:45 +03:00
parent 2d17bd02a3
commit e7104b5ebe
8 changed files with 158 additions and 39 deletions

View File

@@ -494,9 +494,13 @@ void StickerSetBox::Inner::installDone(
const bool wasArchived = (_setFlags & MTPDstickerSet::Flag::f_archived);
if (wasArchived) {
const auto index = stickers.archivedSetsOrderRef().indexOf(_setId);
const auto index = (isMasks
? stickers.archivedMaskSetsOrderRef()
: stickers.archivedSetsOrderRef()).indexOf(_setId);
if (index >= 0) {
stickers.archivedSetsOrderRef().removeAt(index);
(isMasks
? stickers.archivedMaskSetsOrderRef()
: stickers.archivedSetsOrderRef()).removeAt(index);
}
}
_setInstallDate = base::unixtime::now();
@@ -556,7 +560,11 @@ void StickerSetBox::Inner::installDone(
} else {
auto &storage = _controller->session().local();
if (wasArchived) {
storage.writeArchivedStickers();
if (isMasks) {
storage.writeArchivedMasks();
} else {
storage.writeArchivedStickers();
}
}
if (isMasks) {
storage.writeInstalledMasks();