From 2061210089f117950c7de11822ec48d61386bcb0 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Apr 2021 18:19:05 +0300 Subject: [PATCH] Add groupCall.can_start_video. --- td/generate/scheme/td_api.tl | 3 ++- td/telegram/GroupCallManager.cpp | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 820e262f8..11e97e677 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2162,11 +2162,12 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@participant_count Number of participants in the group call //@loaded_all_participants True, if all group call participants are loaded //@recent_speakers Recently speaking users in the group call +//@can_start_video True, if video can be enabled by group call participants //@mute_new_participants True, if only group call administrators can unmute new participants //@can_change_mute_new_participants True, if the current user can enable or disable mute_new_participants setting //@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on //@duration Call duration; for ended calls only -groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector mute_new_participants:Bool can_change_mute_new_participants:Bool record_duration:int32 duration:int32 = GroupCall; +groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector can_start_video:Bool mute_new_participants:Bool can_change_mute_new_participants:Bool record_duration:int32 duration:int32 = GroupCall; //@description Represents a group call participant diff --git a/td/telegram/GroupCallManager.cpp b/td/telegram/GroupCallManager.cpp index 0c6164c24..ce432c23d 100644 --- a/td/telegram/GroupCallManager.cpp +++ b/td/telegram/GroupCallManager.cpp @@ -748,6 +748,7 @@ struct GroupCallManager::GroupCall { bool is_speaking = false; bool can_self_unmute = false; bool can_be_managed = false; + bool can_start_video = false; bool syncing_participants = false; bool need_syncing_participants = false; bool loaded_all_participants = false; @@ -767,6 +768,7 @@ struct GroupCallManager::GroupCall { int32 version = -1; int32 leave_version = -1; int32 title_version = -1; + int32 can_start_video_version = -1; int32 start_subscribed_version = -1; int32 mute_version = -1; int32 stream_dc_id_version = -1; @@ -3544,6 +3546,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptrid_, group_call->access_hash_); call.is_active = true; call.title = std::move(group_call->title_); + call.can_start_video = group_call->can_start_video_; call.start_subscribed = group_call->schedule_start_subscribed_; call.mute_new_participants = group_call->join_muted_; call.joined_date_asc = group_call->join_date_asc_; @@ -3577,6 +3580,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptrversion_; call.title_version = group_call->version_; + call.can_start_video_version = group_call->version_; call.start_subscribed_version = group_call->version_; call.mute_version = group_call->version_; call.stream_dc_id_version = group_call->version_; @@ -3649,6 +3653,12 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptrcan_start_video && + call.can_start_video_version >= group_call->can_start_video_version) { + group_call->can_start_video = call.can_start_video; + group_call->can_start_video_version = call.can_start_video_version; + need_update = true; + } if (call.start_subscribed != group_call->start_subscribed && call.start_subscribed_version >= group_call->start_subscribed_version) { auto old_start_subscribed = get_group_call_start_subscribed(group_call); @@ -4059,8 +4069,8 @@ tl_object_ptr GroupCallManager::get_group_call_object( return td_api::make_object( group_call->group_call_id.get(), get_group_call_title(group_call), scheduled_start_date, start_subscribed, is_active, is_joined, group_call->need_rejoin, group_call->can_be_managed, group_call->participant_count, - group_call->loaded_all_participants, std::move(recent_speakers), mute_new_participants, - can_change_mute_new_participants, record_duration, group_call->duration); + group_call->loaded_all_participants, std::move(recent_speakers), group_call->can_start_video, + mute_new_participants, can_change_mute_new_participants, record_duration, group_call->duration); } tl_object_ptr GroupCallManager::get_update_group_call_object(