From c03650a920001675b8eb4d5807b8ad8118415f08 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 18 Dec 2023 16:03:15 +0300 Subject: [PATCH] Add td_api::chatEventProfileAccentColorChanged. --- td/generate/scheme/td_api.tl | 7 +++++++ td/telegram/DialogEventLog.cpp | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 737f7954b..3c1d00e76 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4360,6 +4360,13 @@ chatEventActiveUsernamesChanged old_usernames:vector new_usernames:vecto //@new_background_custom_emoji_id New identifier of the custom emoji; 0 if none chatEventAccentColorChanged old_accent_color_id:int32 old_background_custom_emoji_id:int64 new_accent_color_id:int32 new_background_custom_emoji_id:int64 = ChatEventAction; +//@description The chat's profile accent color or profile background custom emoji were changed +//@old_profile_accent_color_id Previous identifier of chat's profile accent color; -1 if none +//@old_profile_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_profile_accent_color_id New identifier of chat's profile accent color; -1 if none +//@new_profile_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventProfileAccentColorChanged old_profile_accent_color_id:int32 old_profile_background_custom_emoji_id:int64 new_profile_accent_color_id:int32 new_profile_background_custom_emoji_id:int64 = ChatEventAction; + //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; diff --git a/td/telegram/DialogEventLog.cpp b/td/telegram/DialogEventLog.cpp index b1fba6d76..35f740ec8 100644 --- a/td/telegram/DialogEventLog.cpp +++ b/td/telegram/DialogEventLog.cpp @@ -440,8 +440,16 @@ static td_api::object_ptr get_chat_event_action_object( td->theme_manager_->get_accent_color_id_object(new_peer_color.accent_color_id_, AccentColorId(channel_id)), new_peer_color.background_custom_emoji_id_.get()); } - case telegram_api::channelAdminLogEventActionChangeProfilePeerColor::ID: - return nullptr; + case telegram_api::channelAdminLogEventActionChangeProfilePeerColor::ID: { + auto action = move_tl_object_as(action_ptr); + auto old_peer_color = PeerColor(action->prev_value_); + auto new_peer_color = PeerColor(action->new_value_); + return td_api::make_object( + td->theme_manager_->get_profile_accent_color_id_object(old_peer_color.accent_color_id_), + old_peer_color.background_custom_emoji_id_.get(), + td->theme_manager_->get_profile_accent_color_id_object(new_peer_color.accent_color_id_), + new_peer_color.background_custom_emoji_id_.get()); + } case telegram_api::channelAdminLogEventActionChangeWallpaper::ID: return nullptr; case telegram_api::channelAdminLogEventActionChangeEmojiStatus::ID: