Added phrase of global TTL for new chats.

This commit is contained in:
23rd 2022-11-29 22:39:43 +03:00
parent 377ee7df06
commit 81c48e1b09

View File

@ -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(