Changed sort by DocumentId wit sort by index for gift sticker fallback.

This commit is contained in:
23rd 2022-07-28 01:39:00 +03:00
parent c1fa39ac05
commit de7f983aeb
1 changed files with 5 additions and 5 deletions

View File

@ -62,13 +62,13 @@ void GiftBoxPack::applySet(const MTPDmessages_stickerSet &data) {
const auto document = _session->data().processDocument(sticker);
if (document->sticker()) {
documents.emplace(document->id, document);
if (_documents.empty()) {
// Fallback.
_documents.resize(1);
_documents[0] = document;
}
}
}
if (!documents.empty()) {
// Fallback.
_documents.resize(1);
_documents[0] = documents.begin()->second.get();
}
for (const auto &pack : data.vpacks().v) {
pack.match([&](const MTPDstickerPack &data) {
const auto emoji = qs(data.vemoticon());