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

Colorize emoji in text color correctly.

This commit is contained in:
John Preston
2022-12-15 19:10:51 +04:00
parent 1ab8830ba8
commit 833a259234
35 changed files with 176 additions and 147 deletions

View File

@@ -327,6 +327,7 @@ void DocumentData::setattributes(
const QVector<MTPDocumentAttribute> &attributes) {
_flags &= ~(Flag::ImageType
| Flag::HasAttachedStickers
| Flag::UseTextColor
| kStreamingSupportedMask);
_flags |= kStreamingSupportedUnknown;
@@ -375,6 +376,9 @@ void DocumentData::setattributes(
} else {
_flags |= Flag::PremiumSticker;
}
if (data.is_text_color()) {
_flags |= Flag::UseTextColor;
}
UpdateStickerSetIdentifier(info->set, data.vstickerset());
}
}, [&](const MTPDdocumentAttributeVideo &data) {
@@ -555,6 +559,10 @@ bool DocumentData::isPremiumEmoji() const {
return info && info->setType == Data::StickersType::Emoji;
}
bool DocumentData::emojiUsesTextColor() const {
return (_flags & Flag::UseTextColor);
}
bool DocumentData::hasThumbnail() const {
return _thumbnail.location.valid()
&& !thumbnailFailed()