From 47a445851a8c4a25aa5df2afb4829e9728f5bee5 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 4 Jan 2022 17:55:57 +0300 Subject: [PATCH] Add td_api::chatEventAvailableReactionsChanged. --- td/generate/scheme/td_api.tl | 3 +++ td/telegram/DialogEventLog.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index af049e3c3..c807ce425 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2573,6 +2573,9 @@ chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:Cha //@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; +//@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions +chatEventAvailableReactionsChanged old_available_reactions:vector new_available_reactions:vector = ChatEventAction; + //@description The chat description was changed @old_description Previous chat description @new_description New chat description chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; diff --git a/td/telegram/DialogEventLog.cpp b/td/telegram/DialogEventLog.cpp index 1ef51c619..802a92e23 100644 --- a/td/telegram/DialogEventLog.cpp +++ b/td/telegram/DialogEventLog.cpp @@ -340,8 +340,16 @@ static td_api::object_ptr get_chat_event_action_object( auto action = move_tl_object_as(action_ptr); return td_api::make_object(action->new_value_); } - case telegram_api::channelAdminLogEventActionChangeAvailableReactions::ID: - return nullptr; + case telegram_api::channelAdminLogEventActionChangeAvailableReactions::ID: { + auto action = move_tl_object_as(action_ptr); + auto old_value = td->stickers_manager_->get_active_reactions(std::move(action->prev_value_)); + auto new_value = td->stickers_manager_->get_active_reactions(std::move(action->new_value_)); + if (old_value == new_value) { + return nullptr; + } + return td_api::make_object(std::move(old_value), + std::move(new_value)); + } default: UNREACHABLE(); return nullptr;