From 4875f0b003af9215876a57c13d42554cade9dcd9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 23 Feb 2021 20:44:37 +0400 Subject: [PATCH] Improve auto-delete service messages. --- Telegram/Resources/langs/lang.strings | 2 ++ Telegram/SourceFiles/history/history_service.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index d35edf2f81..4cdcaa5ad2 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -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}»"; diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index 2261bac1e8..98876178e7 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -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) {