From c8a05137f4525df8bc0886ae3b55c96ad75da7cc Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 3 Dec 2018 19:32:07 +0400 Subject: [PATCH] Fix mime type usage for some MP3 files. They had "audio/mpeg3" instead of "audio/mp3". Fixes #5392. --- Telegram/SourceFiles/core/mime_type.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/core/mime_type.cpp b/Telegram/SourceFiles/core/mime_type.cpp index b7f7c10d0..16b0059c7 100644 --- a/Telegram/SourceFiles/core/mime_type.cpp +++ b/Telegram/SourceFiles/core/mime_type.cpp @@ -46,12 +46,14 @@ QString MimeType::name() const { } MimeType MimeTypeForName(const QString &mime) { - if (mime == qsl("image/webp")) { + if (mime == qstr("image/webp")) { return MimeType(MimeType::Known::WebP); - } else if (mime == qsl("application/x-tdesktop-theme")) { + } else if (mime == qstr("application/x-tdesktop-theme")) { return MimeType(MimeType::Known::TDesktopTheme); - } else if (mime == qsl("application/x-tdesktop-palette")) { + } else if (mime == qstr("application/x-tdesktop-palette")) { return MimeType(MimeType::Known::TDesktopPalette); + } else if (mime == qstr("audio/mpeg3")) { + return MimeType(QMimeDatabase().mimeTypeForName("audio/mp3")); } return MimeType(QMimeDatabase().mimeTypeForName(mime)); }