diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 9e4a2eefec..f8e7033d4e 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1529,6 +1529,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "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_global" = "{from} uses a self-destruct timer for all chats. All new messages in this chat will be automatically deleted after {duration} they've been sent."; +"lng_action_ttl_global_me" = "You set a self-destruct timer for all chats. All new messages in this chat will be automatically deleted after {duration} they’ve been sent."; "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"; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index b992a7f6c9..2ea02494d1 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -3676,18 +3676,22 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { const auto duration = (period == 5) ? u"5 seconds"_q : Ui::FormatTTL(period); - if (const auto from = action.vauto_setting_from()) { + if (const auto from = action.vauto_setting_from(); from && period) { if (const auto peer = _from->owner().peer(peerFromUser(*from))) { - if (!peer->isSelf() && period) { - result.text = tr::lng_action_ttl_global( + result.text = (peer->id == peer->session().userPeerId()) + ? tr::lng_action_ttl_global_me( + tr::now, + lt_duration, + { .text = duration }, + Ui::Text::WithEntities) + : tr::lng_action_ttl_global( tr::now, lt_from, - fromLinkText(), // Link 1. + Ui::Text::Link(peer->name(), 1), // Link 1. lt_duration, { .text = duration }, Ui::Text::WithEntities); - return result; - } + return result; } } if (isPost()) {