diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 360f9fe53..a170ea5f6 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1908,6 +1908,9 @@ chatEventPhotoChanged old_photo:photo new_photo:photo = ChatEventAction; //@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; +//@description The linked_chat_id of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier +chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; + //@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 9b638e0fa..c47c8ab75 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 3aacbb3bf..138d53c0c 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23566,6 +23566,28 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob auto action = move_tl_object_as(action_ptr); return make_tl_object(!action->new_value_); } + case telegram_api::channelAdminLogEventActionChangeLinkedChat::ID: { + auto action = move_tl_object_as(action_ptr); + + auto get_dialog_from_channel_id = [this](int32 channel_id_int) { + ChannelId channel_id(channel_id_int); + if (!channel_id.is_valid()) { + return DialogId(); + } + + DialogId dialog_id(channel_id); + force_create_dialog(dialog_id, "get_dialog_from_channel_id"); + return dialog_id; + }; + + auto old_linked_dialog_id = get_dialog_from_channel_id(action->prev_value_); + auto new_linked_dialog_id = get_dialog_from_channel_id(action->new_value_); + if (old_linked_dialog_id == new_linked_dialog_id) { + LOG(ERROR) << "Receive the same linked " << new_linked_dialog_id; + return nullptr; + } + return make_tl_object(old_linked_dialog_id.get(), new_linked_dialog_id.get()); + } default: UNREACHABLE(); return nullptr;