From 9400447fde138f973f85bc01a160854081afe532 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 8 Feb 2024 13:46:45 +0300 Subject: [PATCH] Add td_api::chatEventCustomEmojiStickerSetChanged. --- td/generate/scheme/td_api.tl | 3 +++ td/telegram/DialogEventLog.cpp | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index e813d82c5..eb0ccab89 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4503,6 +4503,9 @@ chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int3 //@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; +//@description The supergroup sticker set with allowed custom emoji was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +chatEventCustomEmojiStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; + //@description The chat title was changed @old_title Previous chat title @new_title New chat title chatEventTitleChanged old_title:string new_title:string = ChatEventAction; diff --git a/td/telegram/DialogEventLog.cpp b/td/telegram/DialogEventLog.cpp index b8eb35032..0e17b6065 100644 --- a/td/telegram/DialogEventLog.cpp +++ b/td/telegram/DialogEventLog.cpp @@ -227,7 +227,15 @@ static td_api::object_ptr get_chat_event_action_object( new_sticker_set_id.get()); } case telegram_api::channelAdminLogEventActionChangeEmojiStickerSet::ID: { - return nullptr; + auto action = move_tl_object_as(action_ptr); + auto old_sticker_set_id = td->stickers_manager_->add_sticker_set(std::move(action->prev_stickerset_)); + auto new_sticker_set_id = td->stickers_manager_->add_sticker_set(std::move(action->new_stickerset_)); + if (!old_sticker_set_id.is_valid() || !new_sticker_set_id.is_valid()) { + LOG(ERROR) << "Skip " << to_string(action); + return nullptr; + } + return td_api::make_object(old_sticker_set_id.get(), + new_sticker_set_id.get()); } case telegram_api::channelAdminLogEventActionTogglePreHistoryHidden::ID: { auto action = move_tl_object_as(action_ptr);