mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Move stickers state variables to AuthSessionData.
Also allow to click on the selected set when choosing megagroup sticker set and allow to paste a t.me link to the set there.
This commit is contained in:
@@ -137,12 +137,12 @@ QString saveFileName(const QString &title, const QString &filter, const QString
|
||||
bool StickerData::setInstalled() const {
|
||||
switch (set.type()) {
|
||||
case mtpc_inputStickerSetID: {
|
||||
auto it = Global::StickerSets().constFind(set.c_inputStickerSetID().vid.v);
|
||||
return (it != Global::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);
|
||||
} break;
|
||||
case mtpc_inputStickerSetShortName: {
|
||||
auto name = qs(set.c_inputStickerSetShortName().vshort_name).toLower();
|
||||
for (auto it = Global::StickerSets().cbegin(), e = Global::StickerSets().cend(); it != e; ++it) {
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user