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

Fix sticker set icons display.

This commit is contained in:
John Preston
2020-05-28 15:58:50 +04:00
parent 803593cd8d
commit ae9ed820ee
16 changed files with 393 additions and 445 deletions

View File

@@ -3887,29 +3887,33 @@ void importOldRecentStickers() {
auto &recent = cRefRecentStickers();
recent.clear();
const auto def = sets.emplace(Stickers::DefaultSetId, std::make_unique<Stickers::Set>(
&Auth().data(),
const auto def = sets.emplace(
Stickers::DefaultSetId,
uint64(0),
tr::lng_stickers_default_set(tr::now),
QString(),
0, // count
0, // hash
(MTPDstickerSet::Flag::f_official
| MTPDstickerSet::Flag::f_installed_date
| MTPDstickerSet_ClientFlag::f_special),
kDefaultStickerInstallDate)).first->second.get();
const auto custom = sets.emplace(Stickers::CustomSetId, std::make_unique<Stickers::Set>(
&Auth().data(),
std::make_unique<Stickers::Set>(
&Auth().data(),
Stickers::DefaultSetId,
uint64(0),
tr::lng_stickers_default_set(tr::now),
QString(),
0, // count
0, // hash
(MTPDstickerSet::Flag::f_official
| MTPDstickerSet::Flag::f_installed_date
| MTPDstickerSet_ClientFlag::f_special),
kDefaultStickerInstallDate)).first->second.get();
const auto custom = sets.emplace(
Stickers::CustomSetId,
uint64(0),
qsl("Custom stickers"),
QString(),
0, // count
0, // hash
(MTPDstickerSet::Flag::f_installed_date
| MTPDstickerSet_ClientFlag::f_special),
kDefaultStickerInstallDate)).first->second.get();
std::make_unique<Stickers::Set>(
&Auth().data(),
Stickers::CustomSetId,
uint64(0),
qsl("Custom stickers"),
QString(),
0, // count
0, // hash
(MTPDstickerSet::Flag::f_installed_date
| MTPDstickerSet_ClientFlag::f_special),
kDefaultStickerInstallDate)).first->second.get();
QMap<uint64, bool> read;
while (!stickers.stream.atEnd()) {
@@ -4035,8 +4039,8 @@ int32 countDocumentVectorHash(const QVector<DocumentData*> vector) {
}
int32 countSpecialStickerSetHash(uint64 setId) {
auto &sets = Auth().data().stickerSets();
auto it = sets.find(setId);
const auto &sets = Auth().data().stickerSets();
const auto it = sets.find(setId);
if (it != sets.cend()) {
return countDocumentVectorHash(it->second->stickers);
}