From 81c48e1b097adb760222948bdb32ac572841e0e4 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 29 Nov 2022 22:39:43 +0300 Subject: [PATCH] Added phrase of global TTL for new chats. --- Telegram/SourceFiles/history/history_service.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index 10492a3a81..f01683d779 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -512,6 +512,20 @@ void HistoryService::setMessageByAction(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 peer = _from->owner().peer(peerFromUser(*from))) { + if (!peer->isSelf() && period) { + result.text = tr::lng_action_ttl_global( + tr::now, + lt_from, + fromLinkText(), // Link 1. + lt_duration, + { .text = duration }, + Ui::Text::WithEntities); + return result; + } + } + } if (isPost()) { if (!period) { result.text = tr::lng_action_ttl_removed_channel(