From f9d10094acc1a07561e828ada0826549e2fb8b1f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 9 Sep 2019 17:57:53 +0300 Subject: [PATCH] Added warning when try to attach new media while editing message. --- Telegram/Resources/langs/lang.strings | 1 + Telegram/SourceFiles/history/history_widget.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index f8bde8210..7afb4b7bc 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -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"; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 13c2f2575..fb8119468 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3197,6 +3197,11 @@ bool HistoryWidget::recordingAnimationCallback(crl::time now) { } void HistoryWidget::chooseAttach() { + if (_editMsgId) { + Ui::show(Box(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(tr::lng_edit_caption_attach(tr::now))); + return false; + } const auto noCompressOption = (list.files.size() > 1) && !list.allFilesForCompress