diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 5b3f602fb1..21124a0c73 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3009,6 +3009,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_admin_log_changed_link_channel" = "{from} changed channel link:"; "lng_admin_log_removed_link_channel" = "{from} removed channel link"; "lng_admin_log_previous_link" = "Previous link"; +"lng_admin_log_reordered_link_group" = "{from} reordered group links:"; +"lng_admin_log_reordered_link_channel" = "{from} reordered channel links:"; +"lng_admin_log_previous_links_order" = "Previous order"; +"lng_admin_log_activated_link" = "{from} activated @{link} username"; +"lng_admin_log_deactivated_link" = "{from} deactivated @{link} username"; "lng_admin_log_changed_photo_group" = "{from} changed group photo"; "lng_admin_log_changed_photo_channel" = "{from} changed channel photo"; "lng_admin_log_removed_photo_group" = "{from} removed group photo"; diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index e9e4441b55..b0d550729d 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -1582,27 +1582,50 @@ void GenerateItems( return true; }(); if (wasReordered) { - auto resultText = fromLinkText; - addSimpleServiceMessage(resultText.append({ - .text = channel->isMegagroup() - ? QString(" reordered group links:") - : QString(" reordered channel links:"), - })); + addSimpleServiceMessage((channel->isMegagroup() + ? tr::lng_admin_log_reordered_link_group + : tr::lng_admin_log_reordered_link_channel)( + tr::now, + lt_from, + fromLinkText, + Ui::Text::WithEntities)); const auto body = makeSimpleTextMessage(list(newValue)); body->addLogEntryOriginal( id, - "Previous order", + tr::lng_admin_log_previous_links_order(tr::now), list(oldValue)); addPart(body); return; } } + } else if (std::abs(newValue.size() - oldValue.size()) == 1) { + const auto activated = newValue.size() > oldValue.size(); + const auto changed = [&] { + const auto value = activated ? oldValue : newValue; + for (const auto &link : (activated ? newValue : oldValue)) { + if (!ranges::contains(value, link)) { + return qs(link); + } + } + return QString(); + }(); + addSimpleServiceMessage((activated + ? tr::lng_admin_log_activated_link + : tr::lng_admin_log_deactivated_link)( + tr::now, + lt_from, + fromLinkText, + lt_link, + { changed }, + Ui::Text::WithEntities)); + return; } + // Probably will never happen. auto resultText = fromLinkText; addSimpleServiceMessage(resultText.append({ .text = channel->isMegagroup() - ? QString(" changed list of group links:") - : QString(" changed list of channel links:"), + ? u" changed list of group links:"_q + : u" changed list of channel links:"_q, })); const auto body = makeSimpleTextMessage(list(newValue)); body->addLogEntryOriginal( diff --git a/Telegram/lib_base b/Telegram/lib_base index 2dc6281594..61cf9a34b2 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 2dc6281594037047cd7ea376fff28629035d93e0 +Subproject commit 61cf9a34b27ad697d88396b6543e019d696f2932