mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Correctly detect Webm stickers.
This commit is contained in:
parent
8b7d2c880e
commit
2f01efdd64
1 changed files with 13 additions and 7 deletions
|
@ -321,21 +321,25 @@ void DocumentData::setattributes(
|
|||
dimensions = QSize(data.vw().v, data.vh().v);
|
||||
}, [&](const MTPDdocumentAttributeAnimated &data) {
|
||||
if (type == FileDocument
|
||||
|| type == StickerDocument
|
||||
|| type == VideoDocument) {
|
||||
|| type == VideoDocument
|
||||
|| (sticker() && sticker()->type != StickerType::Webm)) {
|
||||
type = AnimatedDocument;
|
||||
_additional = nullptr;
|
||||
}
|
||||
}, [&](const MTPDdocumentAttributeSticker &data) {
|
||||
if (type == FileDocument) {
|
||||
const auto was = type;
|
||||
if (type == FileDocument || type == VideoDocument) {
|
||||
type = StickerDocument;
|
||||
_additional = std::make_unique<StickerData>();
|
||||
}
|
||||
if (sticker()) {
|
||||
sticker()->alt = qs(data.valt());
|
||||
if (!sticker()->set.id
|
||||
if (const auto info = sticker()) {
|
||||
if (was == VideoDocument) {
|
||||
info->type = StickerType::Webm;
|
||||
}
|
||||
info->alt = qs(data.valt());
|
||||
if (!info->set.id
|
||||
|| data.vstickerset().type() == mtpc_inputStickerSetID) {
|
||||
sticker()->set = data.vstickerset().match([&](
|
||||
info->set = data.vstickerset().match([&](
|
||||
const MTPDinputStickerSetID &data) {
|
||||
return StickerSetIdentifier{
|
||||
.id = data.vid().v,
|
||||
|
@ -355,6 +359,8 @@ void DocumentData::setattributes(
|
|||
type = data.is_round_message()
|
||||
? RoundVideoDocument
|
||||
: VideoDocument;
|
||||
} else if (const auto info = sticker()) {
|
||||
info->type = StickerType::Webm;
|
||||
}
|
||||
_duration = data.vduration().v;
|
||||
setMaybeSupportsStreaming(data.is_supports_streaming());
|
||||
|
|
Loading…
Add table
Reference in a new issue