2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +00:00

Moved searching of sticker mimes to single place.

This commit is contained in:
23rd
2020-01-07 13:41:13 +03:00
committed by John Preston
parent f3595e379c
commit d1d5312ead
7 changed files with 17 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h"
#include "api/api_text_entities.h"
#include "core/application.h"
#include "core/mime_type.h" // Core::IsMimeSticker
#include "core/crash_reports.h" // CrashReports::SetAnnotation
#include "ui/image/image.h"
#include "ui/image/image_source.h" // Images::LocalFileSource
@@ -2390,8 +2391,7 @@ not_null<DocumentData*> Session::processDocument(
case mtpc_document: {
const auto &fields = data.c_document();
const auto mime = qs(fields.vmime_type());
const auto format = (mime == qstr("image/webp")
|| mime == qstr("application/x-tgsticker"))
const auto format = Core::IsMimeSticker(mime)
? "WEBP"
: "JPG";
return document(