2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Update API scheme on layer 142: Premium stickers.

This commit is contained in:
John Preston
2022-04-21 15:06:50 +04:00
parent c3386fba52
commit 5874ae7c51
18 changed files with 85 additions and 16 deletions

View File

@@ -465,7 +465,8 @@ bool DocumentData::checkWallPaperProperties() {
void DocumentData::updateThumbnails(
const InlineImageLocation &inlineThumbnail,
const ImageWithLocation &thumbnail,
const ImageWithLocation &videoThumbnail) {
const ImageWithLocation &videoThumbnail,
bool isPremiumSticker) {
if (!inlineThumbnail.bytes.isEmpty()
&& _inlineThumbnailBytes.isEmpty()) {
_inlineThumbnailBytes = inlineThumbnail.bytes;
@@ -475,6 +476,11 @@ void DocumentData::updateThumbnails(
_flags &= ~Flag::InlineThumbnailIsPath;
}
}
if (isPremiumSticker) {
_flags |= Flag::PremiumSticker;
} else {
_flags &= ~Flag::PremiumSticker;
}
Data::UpdateCloudFile(
_thumbnail,
thumbnail,
@@ -511,6 +517,10 @@ bool DocumentData::isPatternWallPaperSVG() const {
return isWallPaper() && hasMimeType(qstr("application/x-tgwallpattern"));
}
bool DocumentData::isPremiumSticker() const {
return (_flags & Flag::PremiumSticker);
}
bool DocumentData::hasThumbnail() const {
return _thumbnail.location.valid();
}