Improve auto-delete service messages.

This commit is contained in:
John Preston 2021-02-23 20:44:37 +04:00
parent 522a71f7dc
commit 4875f0b003
2 changed files with 8 additions and 0 deletions

View File

@ -1120,8 +1120,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_action_changed_title_channel" = "Channel name was changed to «{title}»";
"lng_action_created_chat" = "{from} created group «{title}»";
"lng_action_ttl_changed" = "{from} has set messages to auto-delete in {duration}";
"lng_action_ttl_changed_you" = "You set messages to auto-delete in {duration}";
"lng_action_ttl_changed_channel" = "New messages will auto-delete in {duration}";
"lng_action_ttl_removed" = "{from} has set messages not to auto-delete";
"lng_action_ttl_removed_you" = "You disabled the auto-delete timer";
"lng_action_ttl_removed_channel" = "New messages will not auto-delete";
"lng_action_created_channel" = "Channel created";
"lng_action_pinned_message" = "{from} pinned «{text}»";

View File

@ -385,6 +385,12 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
} else {
result.text = tr::lng_action_ttl_changed_channel(tr::now, lt_duration, duration);
}
} else if (_from->isSelf()) {
if (!period) {
result.text = tr::lng_action_ttl_removed_you(tr::now);
} else {
result.text = tr::lng_action_ttl_changed_you(tr::now, lt_duration, duration);
}
} else {
result.links.push_back(fromLink());
if (!period) {