2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Search stickers by emoji.

This commit is contained in:
John Preston
2023-01-24 18:46:16 +04:00
parent 65b1a0c9a4
commit c48ac28204
11 changed files with 161 additions and 85 deletions

View File

@@ -1656,8 +1656,8 @@ void Account::writeStickerSet(
}
stream << qint32(set.emoji.size());
for (auto j = set.emoji.cbegin(), e = set.emoji.cend(); j != e; ++j) {
stream << j.key()->id() << qint32(j->size());
for (const auto sticker : *j) {
stream << j->first->id() << qint32(j->second.size());
for (const auto sticker : j->second) {
stream << quint64(sticker->id);
}
}
@@ -1724,7 +1724,7 @@ void Account::writeStickerSets(
size += sizeof(qint32); // emojiCount
for (auto j = raw->emoji.cbegin(), e = raw->emoji.cend(); j != e; ++j) {
size += Serialize::stringSize(j.key()->id()) + sizeof(qint32) + (j->size() * sizeof(quint64));
size += Serialize::stringSize(j->first->id()) + sizeof(qint32) + (j->second.size() * sizeof(quint64));
}
++setsCount;
@@ -1960,7 +1960,7 @@ void Account::readStickerSets(
if (fillStickers) {
if (auto emoji = Ui::Emoji::Find(emojiString)) {
emoji = emoji->original();
set->emoji.insert(emoji, pack);
set->emoji[emoji] = std::move(pack);
}
}
}