mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Don't store MTPInputStickerSet in data.
This commit is contained in:
@@ -80,6 +80,13 @@ MTPInputStickerSet StickersSet::mtpInput() const {
|
||||
: MTP_inputStickerSetShortName(MTP_string(shortName));
|
||||
}
|
||||
|
||||
StickerSetIdentifier StickersSet::identifier() const {
|
||||
return StickerSetIdentifier{
|
||||
.id = id,
|
||||
.accessHash = access,
|
||||
};
|
||||
}
|
||||
|
||||
void StickersSet::setThumbnail(const ImageWithLocation &data) {
|
||||
Data::UpdateCloudFile(
|
||||
_thumbnail,
|
||||
@@ -154,4 +161,25 @@ std::shared_ptr<StickersSetThumbnailView> StickersSet::activeThumbnailView() {
|
||||
return _thumbnailView.lock();
|
||||
}
|
||||
|
||||
MTPInputStickerSet InputStickerSet(StickerSetIdentifier id) {
|
||||
return !id
|
||||
? MTP_inputStickerSetEmpty()
|
||||
: id.id
|
||||
? MTP_inputStickerSetID(MTP_long(id.id), MTP_long(id.accessHash))
|
||||
: MTP_inputStickerSetShortName(MTP_string(id.shortName));
|
||||
}
|
||||
|
||||
StickerSetIdentifier FromInputSet(const MTPInputStickerSet &id) {
|
||||
return id.match([](const MTPDinputStickerSetID &data) {
|
||||
return StickerSetIdentifier{
|
||||
.id = data.vid().v,
|
||||
.accessHash = data.vaccess_hash().v,
|
||||
};
|
||||
}, [](const MTPDinputStickerSetShortName &data) {
|
||||
return StickerSetIdentifier{ .shortName = qs(data.vshort_name()) };
|
||||
}, [](const auto &) {
|
||||
return StickerSetIdentifier();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Stickers
|
||||
|
Reference in New Issue
Block a user