Show how much message limit is exceeded when editing.

This commit is contained in:
John Preston 2022-08-17 10:13:49 +03:00
parent 1e2e007d38
commit 8a1118d9bb
4 changed files with 11 additions and 4 deletions

View file

@ -267,7 +267,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_proxy_unsupported" = "Your Telegram Desktop version doesn't support this proxy type or the proxy link is invalid. Please update Telegram Desktop to the latest version.";
"lng_edit_deleted" = "This message was deleted";
"lng_edit_too_long" = "Your message text is too long";
"lng_edit_limit_reached#one" = "You've reached the message text limit. Please make the text shorter by {count} character.";
"lng_edit_limit_reached#other" = "You've reached the message text limit. Please make the text shorter by {count} characters.";
"lng_edit_message" = "Edit message";
"lng_edit_message_text" = "New message text...";
"lng_deleted" = "Deleted Account";

View file

@ -3655,7 +3655,9 @@ void HistoryWidget::saveEditMsg() {
Box<DeleteMessagesBox>(item, suggestModerateActions));
return;
} else if (!left.text.isEmpty()) {
controller()->show(Ui::MakeInformBox(tr::lng_edit_too_long()));
const auto remove = left.text.size();
controller()->show(Ui::MakeInformBox(
tr::lng_edit_limit_reached(tr::now, lt_count, remove)));
return;
}

View file

@ -1065,7 +1065,9 @@ void RepliesWidget::edit(
}
return;
} else if (!left.text.isEmpty()) {
controller()->show(Ui::MakeInformBox(tr::lng_edit_too_long()));
const auto remove = left.text.size();
controller()->show(Ui::MakeInformBox(
tr::lng_edit_limit_reached(tr::now, lt_count, remove)));
return;
}

View file

@ -677,7 +677,9 @@ void ScheduledWidget::edit(
}
return;
} else if (!left.text.isEmpty()) {
controller()->show(Ui::MakeInformBox(tr::lng_edit_too_long()));
const auto remove = left.text.size();
controller()->show(Ui::MakeInformBox(
tr::lng_edit_limit_reached(tr::now, lt_count, remove)));
return;
}