2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +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

@@ -34,9 +34,7 @@ bool HasExtensionFrom(const QString &file, const QStringList &extensions) {
bool ValidPhotoForAlbum(
const FileMediaInformation::Image &image,
const QString &mime) {
if (image.animated
|| mime == qstr("image/webp")
|| mime == qstr("application/x-tgsticker")) {
if (image.animated || Core::IsMimeSticker(mime)) {
return false;
}
const auto width = image.data.width();
@@ -397,7 +395,7 @@ bool PreparedList::canAddCaption(bool isAlbum, bool compressImages) const {
if (files.empty()) {
return false;
}
return (files.front().mime == qstr("image/webp"))
return Core::IsMimeSticker(files.front().mime)
|| files.front().path.endsWith(
qstr(".tgs"),
Qt::CaseInsensitive);