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

Update API scheme.

This commit is contained in:
John Preston
2018-01-25 15:28:48 +03:00
parent fe1a90bd39
commit 9515520088
11 changed files with 374 additions and 102 deletions

View File

@@ -155,14 +155,18 @@ QString saveFileName(const QString &title, const QString &filter, const QString
bool StickerData::setInstalled() const {
switch (set.type()) {
case mtpc_inputStickerSetID: {
auto it = Auth().data().stickerSets().constFind(set.c_inputStickerSetID().vid.v);
return (it != Auth().data().stickerSets().cend()) && !(it->flags & MTPDstickerSet::Flag::f_archived) && (it->flags & MTPDstickerSet::Flag::f_installed);
auto it = Auth().data().stickerSets().constFind(
set.c_inputStickerSetID().vid.v);
return (it != Auth().data().stickerSets().cend())
&& !(it->flags & MTPDstickerSet::Flag::f_archived)
&& (it->flags & MTPDstickerSet::Flag::f_installed_date);
} break;
case mtpc_inputStickerSetShortName: {
auto name = qs(set.c_inputStickerSetShortName().vshort_name).toLower();
for (auto it = Auth().data().stickerSets().cbegin(), e = Auth().data().stickerSets().cend(); it != e; ++it) {
if (it->shortName.toLower() == name) {
return !(it->flags & MTPDstickerSet::Flag::f_archived) && (it->flags & MTPDstickerSet::Flag::f_installed);
return !(it->flags & MTPDstickerSet::Flag::f_archived)
&& (it->flags & MTPDstickerSet::Flag::f_installed_date);
}
}
} break;