Added warning when try to attach new media while editing message.

This commit is contained in:
23rd 2019-09-09 17:57:53 +03:00 committed by John Preston
parent 9fc87c3cb8
commit f9d10094ac
2 changed files with 10 additions and 0 deletions

View File

@ -166,6 +166,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"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_edit_caption_attach" = "Sorry, you can't attach a new media while you're editing your message.";
"lng_intro_about" = "Welcome to the official Telegram Desktop app.\nIt's fast and secure.";
"lng_start_msgs" = "START MESSAGING";

View File

@ -3197,6 +3197,11 @@ bool HistoryWidget::recordingAnimationCallback(crl::time now) {
}
void HistoryWidget::chooseAttach() {
if (_editMsgId) {
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
return;
}
if (!_peer || !_peer->canWrite()) {
return;
} else if (const auto error = Data::RestrictionError(
@ -4206,6 +4211,10 @@ bool HistoryWidget::confirmSendingFiles(
if (showSendingFilesError(list)) {
return false;
}
if (_editMsgId) {
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
return false;
}
const auto noCompressOption = (list.files.size() > 1)
&& !list.allFilesForCompress