2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Show only box(512,512) .webp as stickers.

This commit is contained in:
John Preston
2020-07-15 11:49:54 +04:00
parent 9cf15da2b1
commit 8aafe6ba0e
5 changed files with 18 additions and 18 deletions

View File

@@ -47,7 +47,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
const auto kAnimatedStickerDimensions = QSize(512, 512);
const auto kAnimatedStickerDimensions = QSize(
kStickerSideSize,
kStickerSideSize);
QString JoinStringList(const QStringList &list, const QString &separator) {
const auto count = list.size();
@@ -570,15 +572,11 @@ void DocumentData::setattributes(
}, [&](const MTPDdocumentAttributeHasStickers &data) {
});
}
if (type == StickerDocument) {
if (dimensions.width() <= 0
|| dimensions.height() <= 0
|| dimensions.width() > StickerMaxSize
|| dimensions.height() > StickerMaxSize
|| !saveToCache()) {
type = FileDocument;
_additional = nullptr;
}
if (type == StickerDocument
&& (!GoodStickerDimensions(dimensions.width(), dimensions.height())
|| (size > Storage::kMaxStickerBytesSize))) {
type = FileDocument;
_additional = nullptr;
}
if (isAudioFile() || isAnimation() || isVoiceMessage()) {
setMaybeSupportsStreaming(true);