From 61b6effccc19bdced6fc9855761cb6e5b50ead7f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 May 2019 00:27:16 +0300 Subject: [PATCH] View some more files as stickers. --- Telegram/SourceFiles/data/data_document.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index f3e528fcb..2100a9343 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -553,7 +553,11 @@ void DocumentData::setattributes( } void DocumentData::validateLottieSticker() { - if (type == FileDocument && _filename == qstr("animation.json")) { + if (type == FileDocument + && (_filename == qstr("animation.json") + || ((_filename.size() == 9 || _filename.size() == 10) + && _filename.endsWith(qstr(".json")) + && QRegularExpression("^\\d+\\.json$").match(_filename).hasMatch()))) { type = StickerDocument; _additional = std::make_unique(); dimensions = QSize(512, 512);