Added more appropriate phrase for invalid files in edit media.

This commit is contained in:
23rd 2019-04-03 20:08:27 +03:00
parent bd653dfdff
commit 48362cd4bc
3 changed files with 9 additions and 3 deletions

View File

@ -164,6 +164,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_edit_media" = "Edit media";
"lng_edit_media_album_error" = "This file cannot be saved as a part of an album.";
"lng_edit_media_invalid_file" = "Sorry, no way to use this file.";
"lng_intro_about" = "Welcome to the official Telegram Desktop app.\nIt's fast and secure.";
"lng_start_msgs" = "START MESSAGING";

View File

@ -4678,10 +4678,15 @@ void ApiWrap::editUploadedFile(
applyUpdates(result);
}).fail([=](const RPCError &error) {
QString err = error.type();
if (err == qstr("MESSAGE_NOT_MODIFIED")
|| err == qstr("MEDIA_NEW_INVALID")) {
if (err == qstr("MESSAGE_NOT_MODIFIED")) {
item->returnSavedMedia();
_session->data().sendHistoryChangeNotifications();
} else if (err == qstr("MEDIA_NEW_INVALID")) {
item->returnSavedMedia();
_session->data().sendHistoryChangeNotifications();
Ui::show(
Box<InformBox>(lang(lng_edit_media_invalid_file)),
LayerOption::KeepOther);
} else {
sendMessageFail(error);
}

View File

@ -405,7 +405,7 @@ void EditCaptionBox::createEditMediaButton() {
const auto isWebp = [](QString mimeType) {
if (mimeType == qstr("image/webp")) {
Ui::show(
Box<InformBox>(lang(lng_edit_media_album_error)),
Box<InformBox>(lang(lng_edit_media_invalid_file)),
LayerOption::KeepOther);
return true;
}