Combine td_api::chatEventAccentColorChanged and td_api::chatEventBackgroundCustomEmojiChanged.

This commit is contained in:
levlam 2023-12-18 16:00:01 +03:00
parent 9171588824
commit 6b0e161fa2
2 changed files with 17 additions and 7 deletions

View File

@ -4353,11 +4353,12 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi
//@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames
chatEventActiveUsernamesChanged old_usernames:vector<string> new_usernames:vector<string> = ChatEventAction;
//@description The chat accent color was changed @old_accent_color_id Previous identifier of chat accent color @new_accent_color_id New identifier of chat accent color
chatEventAccentColorChanged old_accent_color_id:int32 new_accent_color_id:int32 = ChatEventAction;
//@description The chat's custom emoji for reply background was changed @old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none @new_background_custom_emoji_id New identifier of the custom emoji; 0 if none
chatEventBackgroundCustomEmojiChanged old_background_custom_emoji_id:int64 new_background_custom_emoji_id:int64 = ChatEventAction;
//@description The chat accent color or background custom emoji were changed
//@old_accent_color_id Previous identifier of chat accent color
//@old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none
//@new_accent_color_id New identifier of chat accent color
//@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 has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content
chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction;

View File

@ -21,6 +21,7 @@
#include "td/telegram/MessageSender.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/MessageTtl.h"
#include "td/telegram/PeerColor.h"
#include "td/telegram/Photo.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
@ -429,8 +430,16 @@ static td_api::object_ptr<td_api::ChatEventAction> get_chat_event_action_object(
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionToggleAntiSpam>(action_ptr);
return td_api::make_object<td_api::chatEventHasAggressiveAntiSpamEnabledToggled>(action->new_value_);
}
case telegram_api::channelAdminLogEventActionChangePeerColor::ID:
return nullptr;
case telegram_api::channelAdminLogEventActionChangePeerColor::ID: {
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionChangePeerColor>(action_ptr);
auto old_peer_color = PeerColor(action->prev_value_);
auto new_peer_color = PeerColor(action->new_value_);
return td_api::make_object<td_api::chatEventAccentColorChanged>(
td->theme_manager_->get_accent_color_id_object(old_peer_color.accent_color_id_, AccentColorId(channel_id)),
old_peer_color.background_custom_emoji_id_.get(),
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::channelAdminLogEventActionChangeWallpaper::ID: