Added edit message prevent when there is unsent recorded voice data.
This commit is contained in:
parent
6ecc446a8a
commit
e0cc3791ff
|
@ -184,6 +184,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_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_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_edit_caption_attach" = "Sorry, you can't attach a new media while you're editing your message.";
|
||||||
|
"lng_edit_caption_voice" = "Sorry, you can't edit your message while you're having an unsent voice message.";
|
||||||
|
|
||||||
"lng_intro_about" = "Welcome to the official Telegram Desktop app.\nIt's fast and secure.";
|
"lng_intro_about" = "Welcome to the official Telegram Desktop app.\nIt's fast and secure.";
|
||||||
"lng_start_msgs" = "START MESSAGING";
|
"lng_start_msgs" = "START MESSAGING";
|
||||||
|
|
|
@ -5523,6 +5523,10 @@ void HistoryWidget::editMessage(FullMsgId itemId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
||||||
|
if (_voiceRecordBar && _voiceRecordBar->isListenState()) {
|
||||||
|
Ui::show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (const auto media = item->media()) {
|
if (const auto media = item->media()) {
|
||||||
if (media->allowsEditCaption()) {
|
if (media->allowsEditCaption()) {
|
||||||
Ui::show(Box<EditCaptionBox>(controller(), item));
|
Ui::show(Box<EditCaptionBox>(controller(), item));
|
||||||
|
|
|
@ -1748,6 +1748,11 @@ void ComposeControls::editMessage(not_null<HistoryItem*> item) {
|
||||||
Expects(_history != nullptr);
|
Expects(_history != nullptr);
|
||||||
Expects(draftKeyCurrent() != Data::DraftKey::None());
|
Expects(draftKeyCurrent() != Data::DraftKey::None());
|
||||||
|
|
||||||
|
if (_voiceRecordBar && _voiceRecordBar->isListenState()) {
|
||||||
|
Ui::show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isEditingMessage()) {
|
if (!isEditingMessage()) {
|
||||||
saveFieldToHistoryLocalDraft();
|
saveFieldToHistoryLocalDraft();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue