mirror of
https://github.com/vale981/tdesktop
synced 2025-03-12 05:56:42 -04:00
Offer to delete on editing to empty message.
This commit is contained in:
parent
e42e973ed5
commit
c70e9b529a
1 changed files with 7 additions and 2 deletions
|
@ -2896,8 +2896,13 @@ void HistoryWidget::saveEditMsg() {
|
||||||
TextUtilities::PrepareForSending(left, prepareFlags);
|
TextUtilities::PrepareForSending(left, prepareFlags);
|
||||||
|
|
||||||
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
||||||
_field->selectAll();
|
if (const auto item = App::histItemById(_channel, _editMsgId)) {
|
||||||
_field->setFocus();
|
const auto suggestModerateActions = false;
|
||||||
|
Ui::show(Box<DeleteMessagesBox>(item, suggestModerateActions));
|
||||||
|
} else {
|
||||||
|
_field->selectAll();
|
||||||
|
_field->setFocus();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else if (!left.text.isEmpty()) {
|
} else if (!left.text.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_edit_too_long)));
|
Ui::show(Box<InformBox>(lang(lng_edit_too_long)));
|
||||||
|
|
Loading…
Add table
Reference in a new issue