diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 0b6c55ebb..cf50a1879 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2376,6 +2376,18 @@ chatEventLocationChanged old_location:chatLocation new_location:chatLocation = C //@description The is_all_history_available setting of a supergroup was toggled @is_all_history_available New value of is_all_history_available chatEventIsAllHistoryAvailableToggled is_all_history_available:Bool = ChatEventAction; +//@description A voice chat was created @group_call_id Group call identifier +chatEventVoiceChatCreated group_call_id:int32 = ChatEventAction; + +//@description A voice chat was discarded @group_call_id Group call identifier +chatEventVoiceChatDiscarded group_call_id:int32 = ChatEventAction; + +//@description A voice chat participant was muted or unmuted @user_id Voice chat participant user identifier @is_muted New value of is_muted +chatEventVoiceChatParticipantIsMutedToggled user_id:int32 is_muted:Bool = ChatEventAction; + +//@description The mute_new_participants setting of a voice chat was toggled @mute_new_participants New value of the mute_new_participants setting +chatEventVoiceChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction; + //@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @user_id Identifier of the user who performed the action that triggered the event @action Action performed by the user chatEvent id:int64 date:int32 user_id:int32 action:ChatEventAction = ChatEvent; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 2b4c9dc79..41259c6b1 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 196bd20e6..ed423a472 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23,6 +23,7 @@ #include "td/telegram/files/FileType.h" #include "td/telegram/Global.h" #include "td/telegram/GroupCallManager.h" +#include "td/telegram/GroupCallParticipant.h" #include "td/telegram/InlineQueriesManager.h" #include "td/telegram/InputMessageText.h" #include "td/telegram/Location.h" @@ -30777,12 +30778,46 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob auto new_slow_mode_delay = clamp(action->new_value_, 0, 86400 * 366); return make_tl_object(old_slow_mode_delay, new_slow_mode_delay); } - case telegram_api::channelAdminLogEventActionStartGroupCall::ID: - case telegram_api::channelAdminLogEventActionDiscardGroupCall::ID: - case telegram_api::channelAdminLogEventActionParticipantMute::ID: - case telegram_api::channelAdminLogEventActionParticipantUnmute::ID: - case telegram_api::channelAdminLogEventActionToggleGroupCallSetting::ID: - return nullptr; + case telegram_api::channelAdminLogEventActionStartGroupCall::ID: { + auto action = move_tl_object_as(action_ptr); + auto input_group_call_id = InputGroupCallId(action->call_); + if (!input_group_call_id.is_valid()) { + return nullptr; + } + return make_tl_object( + td_->group_call_manager_->get_group_call_id(input_group_call_id, channel_id).get()); + } + case telegram_api::channelAdminLogEventActionDiscardGroupCall::ID: { + auto action = move_tl_object_as(action_ptr); + auto input_group_call_id = InputGroupCallId(action->call_); + if (!input_group_call_id.is_valid()) { + return nullptr; + } + return make_tl_object( + td_->group_call_manager_->get_group_call_id(input_group_call_id, channel_id).get()); + } + case telegram_api::channelAdminLogEventActionParticipantMute::ID: { + auto action = move_tl_object_as(action_ptr); + GroupCallParticipant participant(std::move(action->participant_)); + if (!participant.is_valid()) { + return nullptr; + } + return make_tl_object( + td_->contacts_manager_->get_user_id_object(participant.user_id, "LogEventActionParticipantMute"), true); + } + case telegram_api::channelAdminLogEventActionParticipantUnmute::ID: { + auto action = move_tl_object_as(action_ptr); + GroupCallParticipant participant(std::move(action->participant_)); + if (!participant.is_valid()) { + return nullptr; + } + return make_tl_object( + td_->contacts_manager_->get_user_id_object(participant.user_id, "LogEventActionParticipantUnmute"), false); + } + case telegram_api::channelAdminLogEventActionToggleGroupCallSetting::ID: { + auto action = move_tl_object_as(action_ptr); + return make_tl_object(action->join_muted_); + } default: UNREACHABLE(); return nullptr;