diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 3e1996f57e..290fc3c369 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3138,6 +3138,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_admin_log_disallowed_unmute_self_channel" = "{from} started muting new live stream members"; "lng_admin_log_participant_volume" = "{from} changed voice chat volume for {user} to {percent}"; "lng_admin_log_participant_volume_channel" = "{from} changed live stream volume for {user} to {percent}"; +"lng_admin_log_antispam_enabled" = "{from} enabled aggressive anti-spam"; +"lng_admin_log_antispam_disabled" = "{from} disabled aggressive anti-spam"; "lng_admin_log_user_with_username" = "{name} ({mention})"; "lng_admin_log_messages_ttl_set" = "{from} enabled messages auto-delete after {duration}"; "lng_admin_log_messages_ttl_changed" = "{from} changed messages auto-delete period from {previous} to {duration}"; diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index d7d961a53b..bf6458df33 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -967,6 +967,7 @@ channelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLo channelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction; channelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction; channelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; 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 d4816981fb..844a97f271 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -741,6 +741,7 @@ void GenerateItems( using LogEditTopic = MTPDchannelAdminLogEventActionEditTopic; using LogDeleteTopic = MTPDchannelAdminLogEventActionDeleteTopic; using LogPinTopic = MTPDchannelAdminLogEventActionPinTopic; + using LogToggleAntiSpam = MTPDchannelAdminLogEventActionToggleAntiSpam; const auto session = &history->session(); const auto id = event.vid().v; @@ -1750,6 +1751,18 @@ void GenerateItems( } }; + const auto createToggleAntiSpam = [&](const LogToggleAntiSpam &data) { + const auto enabled = (data.vnew_value().type() == mtpc_boolTrue); + const auto text = (enabled + ? tr::lng_admin_log_antispam_enabled + : tr::lng_admin_log_antispam_disabled)( + tr::now, + lt_from, + fromLinkText, + Ui::Text::WithEntities); + addSimpleServiceMessage(text); + }; + action.match( createChangeTitle, createChangeAbout, @@ -1792,7 +1805,8 @@ void GenerateItems( createCreateTopic, createEditTopic, createDeleteTopic, - createPinTopic); + createPinTopic, + createToggleAntiSpam); } } // namespace AdminLog