Update API scheme on layer 150: AntiSpam admin log.

This commit is contained in:
John Preston 2022-12-03 18:54:08 +04:00
parent b81868eeba
commit a8c230aba3
3 changed files with 18 additions and 1 deletions

View File

@ -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}";

View File

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

View File

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