mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Fix caching of webm stickers in local storage.
This commit is contained in:
parent
f1d9cca119
commit
1a3a0fb124
2 changed files with 9 additions and 3 deletions
|
@ -1400,6 +1400,10 @@ TimeId DocumentData::getDuration() const {
|
|||
return std::max(voice->duration, 0);
|
||||
} else if (isAnimation() || isVideoFile()) {
|
||||
return std::max(_duration, 0);
|
||||
} else if (const auto sticker = this->sticker()) {
|
||||
if (sticker->isWebm()) {
|
||||
return std::max(_duration, 0);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Serialize {
|
|||
namespace {
|
||||
|
||||
constexpr auto kVersionTag = int32(0x7FFFFFFF);
|
||||
constexpr auto kVersion = 2;
|
||||
constexpr auto kVersion = 3;
|
||||
|
||||
enum StickerSetType {
|
||||
StickerSetTypeEmpty = 0,
|
||||
|
@ -43,9 +43,8 @@ void Document::writeToStream(QDataStream &stream, DocumentData *document) {
|
|||
} else {
|
||||
stream << qint32(StickerSetTypeEmpty);
|
||||
}
|
||||
} else {
|
||||
stream << qint32(document->getDuration());
|
||||
}
|
||||
stream << qint32(document->getDuration());
|
||||
writeImageLocation(stream, document->thumbnailLocation());
|
||||
stream << qint32(document->thumbnailByteSize());
|
||||
writeImageLocation(stream, document->videoThumbnailLocation());
|
||||
|
@ -115,6 +114,9 @@ DocumentData *Document::readFromStreamHelper(
|
|||
} break;
|
||||
}
|
||||
}
|
||||
if (version >= 3) {
|
||||
stream >> duration;
|
||||
}
|
||||
} else {
|
||||
stream >> duration;
|
||||
if (type == AnimatedDocument) {
|
||||
|
|
Loading…
Add table
Reference in a new issue