2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added ability to see attached stickers on documents.

Fixed #8927.
This commit is contained in:
23rd
2020-10-30 04:07:04 +03:00
parent 391ec8ac28
commit 665e322fce
7 changed files with 76 additions and 10 deletions

View File

@@ -499,7 +499,9 @@ Main::Session &DocumentData::session() const {
void DocumentData::setattributes(
const QVector<MTPDocumentAttribute> &attributes) {
_flags &= ~(Flag::ImageType | kStreamingSupportedMask);
_flags &= ~(Flag::ImageType
| Flag::HasAttachedStickers
| kStreamingSupportedMask);
_flags |= kStreamingSupportedUnknown;
validateLottieSticker();
@@ -577,6 +579,7 @@ void DocumentData::setattributes(
_filename = std::move(_filename).replace(ch, "_");
}
}, [&](const MTPDdocumentAttributeHasStickers &data) {
_flags |= Flag::HasAttachedStickers;
});
}
if (type == StickerDocument
@@ -1539,6 +1542,10 @@ bool DocumentData::isImage() const {
return (_flags & Flag::ImageType);
}
bool DocumentData::hasAttachedStickers() const {
return (_flags & Flag::HasAttachedStickers);
}
bool DocumentData::supportsStreaming() const {
return (_flags & kStreamingSupportedMask) == kStreamingSupportedMaybeYes;
}