From fb252bb6448bad7bfd10240462e8d10db4cf0af1 Mon Sep 17 00:00:00 2001 From: John Preston <johnprestonmail@gmail.com> Date: Fri, 9 Aug 2024 16:49:14 +0200 Subject: [PATCH] Update API scheme on layer 186. --- Telegram/Resources/langs/lang.strings | 2 ++ .../history/admin_log/history_admin_log_item.cpp | 16 +++++++++++++++- Telegram/SourceFiles/mtproto/scheme/api.tl | 5 +++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 085cbd39b..734b15c97 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -4342,6 +4342,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_admin_log_invites_disabled" = "{from} disabled group invites"; "lng_admin_log_signatures_enabled" = "{from} enabled signatures"; "lng_admin_log_signatures_disabled" = "{from} disabled signatures"; +"lng_admin_log_signature_profiles_enabled" = "{from} enabled showing authors' profiles"; +"lng_admin_log_signature_profiles_disabled" = "{from} disabled showing authors' profiles"; "lng_admin_log_forwards_enabled" = "{from} allowed content copying"; "lng_admin_log_forwards_disabled" = "{from} restricted content copying"; "lng_admin_log_history_made_hidden" = "{from} made group history hidden for new members"; 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 19f76be07..73370795f 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -779,6 +779,7 @@ void GenerateItems( using LogChangeProfilePeerColor = MTPDchannelAdminLogEventActionChangeProfilePeerColor; using LogChangeWallpaper = MTPDchannelAdminLogEventActionChangeWallpaper; using LogChangeEmojiStatus = MTPDchannelAdminLogEventActionChangeEmojiStatus; + using LogToggleSignatureProfiles = MTPDchannelAdminLogEventActionToggleSignatureProfiles; const auto session = &history->session(); const auto id = event.vid().v; @@ -2015,6 +2016,18 @@ void GenerateItems( addSimpleServiceMessage(text); }; + const auto createToggleSignatureProfiles = [&](const LogToggleSignatureProfiles &action) { + const auto enabled = (action.vnew_value().type() == mtpc_boolTrue); + const auto text = (enabled + ? tr::lng_admin_log_signature_profiles_enabled + : tr::lng_admin_log_signature_profiles_disabled)( + tr::now, + lt_from, + fromLinkText, + Ui::Text::WithEntities); + addSimpleServiceMessage(text); + }; + action.match( createChangeTitle, createChangeAbout, @@ -2063,7 +2076,8 @@ void GenerateItems( createChangePeerColor, createChangeProfilePeerColor, createChangeWallpaper, - createChangeEmojiStatus); + createChangeEmojiStatus, + createToggleSignatureProfiles); } } // namespace AdminLog diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index e8e8f837d..fac8f371e 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -1012,6 +1012,7 @@ channelAdminLogEventActionChangeProfilePeerColor#5e477b25 prev_value:PeerColor n channelAdminLogEventActionChangeWallpaper#31bb5d52 prev_value:WallPaper new_value:WallPaper = ChannelAdminLogEventAction; channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_value:EmojiStatus = ChannelAdminLogEventAction; channelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; @@ -1377,7 +1378,7 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; account.resetPasswordOk#e926d63e = account.ResetPasswordResult; -sponsoredMessage#bdedf566 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage; +sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage; messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages; messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages; @@ -1843,7 +1844,7 @@ bots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> starsSubscriptionPricing#5416d58 period:int amount:long = StarsSubscriptionPricing; -starsSubscription#d073f1e6 flags:# canceled:flags.0?true can_refulfill:flags.1?true missing_balance:flags.2?true id:string peer:Peer until_date:int pricing:StarsSubscriptionPricing = StarsSubscription; +starsSubscription#538ecf18 flags:# canceled:flags.0?true can_refulfill:flags.1?true missing_balance:flags.2?true id:string peer:Peer until_date:int pricing:StarsSubscriptionPricing chat_invite_hash:flags.3?string = StarsSubscription; messageReactor#ef00d448 flags:# top:flags.0?true my:flags.1?true peer_id:Peer count:int = MessageReactor;