2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Support thumb_document_id in emoji sets.

This commit is contained in:
John Preston
2022-07-13 18:05:29 +03:00
parent 64f25a6dae
commit a821c3c31d
9 changed files with 49 additions and 15 deletions

View File

@@ -201,6 +201,7 @@ private:
uint64 _setId = 0;
uint64 _setAccessHash = 0;
uint64 _setHash = 0;
uint64 _setThumbnailDocumentId = 0;
QString _setTitle, _setShortName;
int _setCount = 0;
Data::StickersSetFlags _setFlags;
@@ -549,6 +550,7 @@ void StickerSetBox::Inner::gotSet(const MTPmessages_StickerSet &set) {
_setCount = set.vcount().v;
_setFlags = Data::ParseStickersSetFlags(set);
_setInstallDate = set.vinstalled_date().value_or(0);
_setThumbnailDocumentId = set.vthumb_document_id().value_or_empty();
_setThumbnail = [&] {
if (const auto thumbs = set.vthumbs()) {
for (const auto &thumb : thumbs->v) {
@@ -661,6 +663,7 @@ void StickerSetBox::Inner::installDone(
it->second->installDate = _setInstallDate;
}
const auto set = it->second.get();
set->thumbnailDocumentId = _setThumbnailDocumentId;
set->setThumbnail(_setThumbnail);
set->stickers = _pack;
set->emoji = _emoji;