diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 4c6f2ee31..4917fec94 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1638,7 +1638,7 @@ messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = Mess messageGroupCall group_call_id:int32 duration:int32 = MessageContent; //@description A message with information about an invite to a group call @group_call_id Group call identifier @user_ids Invited user identifiers -messageInviteGroupCallMembers group_call_id:int32 user_ids:vector = MessageContent; +messageInviteGroupCallParticipants group_call_id:int32 user_ids:vector = MessageContent; //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group messageBasicGroupChatCreate title:string member_user_ids:vector = MessageContent; @@ -2066,12 +2066,12 @@ callStateError error:error = CallState; //@id Group call identifier //@is_active True, if the call is active //@is_joined True, if the call is joined -//@member_count Number of members in the group call +//@participant_count Number of participants in the group call //@recent_speaker_user_ids Identifiers of recently speaking users in the group call -//@mute_new_members True, if only group call administrators can unmute new members -//@allowed_change_mute_new_members True, if group call administrators can enable or disable mute_new_members setting +//@mute_new_participants True, if only group call administrators can unmute new participants +//@allowed_change_mute_new_participants True, if group call administrators can enable or disable mute_new_participants setting //@duration Call duration; for ended calls only -groupCall id:int32 is_active:Bool is_joined:Bool member_count:int32 recent_speaker_user_ids:vector mute_new_members:Bool allowed_change_mute_new_members:Bool duration:int32 = GroupCall; +groupCall id:int32 is_active:Bool is_joined:Bool participant_count:int32 recent_speaker_user_ids:vector mute_new_participants:Bool allowed_change_mute_new_participants:Bool duration:int32 = GroupCall; //@description Describes a payload fingerprint for interaction with tgcalls @hash Value of the field hash @setup Value of the field setup @fingerprint Value of the field fingerprint groupCallPayloadFingerprint hash:string setup:string fingerprint:string = GroupCallPayloadFingerprint; @@ -2088,7 +2088,7 @@ groupCallJoinResponseCandidate port:string protocol:string network:string genera groupCallJoinResponse payload:groupCallPayload candidates:vector = GroupCallJoinResponse; //@description Represents a group call participant @user_id Identifier of the user @source User's synchronization source -//@is_speaking True, if the user is speaking as set by setGroupCallMemberIsSpeaking @is_muted True, if the user is muted @can_self_unmute True, if the user can unmute themself +//@is_speaking True, if the user is speaking as set by setGroupCallParticipantIsSpeaking @is_muted True, if the user is muted @can_self_unmute True, if the user can unmute themself //@order User's order in the group call participant list. The bigger is order, the higher is user in the list groupCallParticipant user_id:int32 source:int32 is_speaking:Bool is_muted:Bool can_self_unmute:Bool order:int64 = GroupCallParticipant; @@ -4342,21 +4342,21 @@ getGroupCall group_call_id:int32 = GroupCall; //@description Joins a group call @group_call_id Group call identifier @payload Group join payload, received from tgcalls @source Caller synchronization source identifier; received from tgcalls @is_muted True, if the user's microphone is muted joinGroupCall group_call_id:int32 payload:groupCallPayload source:int32 is_muted:Bool = GroupCallJoinResponse; -//@description Toggles whether new members of a group call can be unmuted only by administrators of the group call. Requires can_manage_voice_chats rights in the corresponding chat and allowed_change_mute_mew_members group call flag -//@group_call_id Group call identifier @mute_new_members New value of the mute_new_members setting -toggleGroupCallMuteNewMembers group_call_id:int32 mute_new_members:Bool = Ok; +//@description Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires can_manage_voice_chats rights in the corresponding chat and allowed_change_mute_mew_participants group call flag +//@group_call_id Group call identifier @mute_new_participants New value of the mute_new_participants setting +toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; //@description Invites users to a group call. Sends a service message of type messageInviteToGroupCall for voice chats //@group_call_id Group call identifier @user_ids User identifiers. At most 10 users can be invited simultaneously -inviteGroupCallMembers group_call_id:int32 user_ids:vector = Ok; +inviteGroupCallParticipants group_call_id:int32 user_ids:vector = Ok; -//@description Informs TDLib that a group call member speaking state has changed @group_call_id Group call identifier -//@source Group call member's synchronization source identifier @is_speaking True, if the user is speaking -setGroupCallMemberIsSpeaking group_call_id:int32 source:int32 is_speaking:Bool = Ok; +//@description Informs TDLib that a group call participant speaking state has changed @group_call_id Group call identifier +//@source Group call participant's synchronization source identifier @is_speaking True, if the user is speaking +setGroupCallParticipantIsSpeaking group_call_id:int32 source:int32 is_speaking:Bool = Ok; -//@description Toggles whether a group call member is muted. Requires can_manage_voice_chats rights to mute other group call members +//@description Toggles whether a group call participant is muted. Requires can_manage_voice_chats rights to mute other group call participants //@group_call_id Group call identifier @user_id User identifier @is_muted Pass true if the user must be muted and false otherwise -toggleGroupCallMemberIsMuted group_call_id:int32 user_id:int32 is_muted:Bool = Ok; +toggleGroupCallParticipantIsMuted group_call_id:int32 user_id:int32 is_muted:Bool = Ok; //@description Checks whether a group call is still joined. Should be called every 10 seconds when tgcalls notifies about lost connection with the server @group_call_id Group call identifier checkGroupCallIsJoined group_call_id:int32 = Ok; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index a0c6f49d1..baab9dc15 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/GroupCallManager.cpp b/td/telegram/GroupCallManager.cpp index 9a48a8416..a8a5e308b 100644 --- a/td/telegram/GroupCallManager.cpp +++ b/td/telegram/GroupCallManager.cpp @@ -371,9 +371,9 @@ struct GroupCallManager::GroupCall { bool is_active = false; bool is_joined = false; bool is_speaking = false; - bool mute_new_members = false; - bool allowed_change_mute_new_members = false; - int32 member_count = 0; + bool mute_new_participants = false; + bool allowed_change_mute_new_participants = false; + int32 participant_count = 0; int32 version = -1; int32 duration = 0; int32 source = 0; @@ -586,7 +586,7 @@ void GroupCallManager::finish_get_group_call(InputGroupCallId input_group_call_i void GroupCallManager::on_get_group_call_participants( InputGroupCallId input_group_call_id, tl_object_ptr &&participants, bool is_load) { - LOG(INFO) << "Receive group call members: " << to_string(participants); + LOG(INFO) << "Receive group call participants: " << to_string(participants); CHECK(participants != nullptr); td_->contacts_manager_->on_get_users(std::move(participants->users_), "on_get_group_call_participants"); @@ -798,17 +798,17 @@ void GroupCallManager::finish_join_group_call(InputGroupCallId input_group_call_ pending_join_requests_.erase(it); } -void GroupCallManager::toggle_group_call_mute_new_members(GroupCallId group_call_id, bool mute_new_members, - Promise &&promise) { +void GroupCallManager::toggle_group_call_mute_new_participants(GroupCallId group_call_id, bool mute_new_participants, + Promise &&promise) { TRY_RESULT_PROMISE(promise, input_group_call_id, get_input_group_call_id(group_call_id)); int32 flags = telegram_api::phone_toggleGroupCallSettings::JOIN_MUTED_MASK; td_->create_handler(std::move(promise)) - ->send(flags, input_group_call_id, mute_new_members); + ->send(flags, input_group_call_id, mute_new_participants); } -void GroupCallManager::invite_group_call_members(GroupCallId group_call_id, vector &&user_ids, - Promise &&promise) { +void GroupCallManager::invite_group_call_participants(GroupCallId group_call_id, vector &&user_ids, + Promise &&promise) { TRY_RESULT_PROMISE(promise, input_group_call_id, get_input_group_call_id(group_call_id)); vector> input_users; @@ -833,8 +833,8 @@ void GroupCallManager::invite_group_call_members(GroupCallId group_call_id, vect td_->create_handler(std::move(promise))->send(input_group_call_id, std::move(input_users)); } -void GroupCallManager::set_group_call_member_is_speaking(GroupCallId group_call_id, int32 source, bool is_speaking, - Promise &&promise) { +void GroupCallManager::set_group_call_participant_is_speaking(GroupCallId group_call_id, int32 source, bool is_speaking, + Promise &&promise) { TRY_RESULT_PROMISE(promise, input_group_call_id, get_input_group_call_id(group_call_id)); auto *group_call = get_group_call(input_group_call_id); @@ -858,13 +858,13 @@ void GroupCallManager::set_group_call_member_is_speaking(GroupCallId group_call_ on_source_speaking_in_group_call(group_call_id, source, G()->unix_time(), false); } - // TODO update member list by others speaking actions + // TODO update participant list by others speaking actions promise.set_value(Unit()); } -void GroupCallManager::toggle_group_call_member_is_muted(GroupCallId group_call_id, UserId user_id, bool is_muted, - Promise &&promise) { +void GroupCallManager::toggle_group_call_participant_is_muted(GroupCallId group_call_id, UserId user_id, bool is_muted, + Promise &&promise) { TRY_RESULT_PROMISE(promise, input_group_call_id, get_input_group_call_id(group_call_id)); if (!td_->contacts_manager_->have_input_user(user_id)) { @@ -963,9 +963,9 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr(group_call_ptr.get()); call_id = InputGroupCallId(group_call->id_, group_call->access_hash_); call.is_active = true; - call.mute_new_members = group_call->join_muted_; - call.allowed_change_mute_new_members = group_call->can_change_join_muted_; - call.member_count = group_call->participants_count_; + call.mute_new_participants = group_call->join_muted_; + call.allowed_change_mute_new_participants = group_call->can_change_join_muted_; + call.participant_count = group_call->participants_count_; call.version = group_call->version_; if (group_call->params_ != nullptr) { join_params = std::move(group_call->params_->data_); @@ -982,7 +982,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptrcontacts_manager_->on_update_channel_group_call(group_call->channel_id, false, false); } } else { - auto mute_flags_changed = call.mute_new_members != group_call->mute_new_members || - call.allowed_change_mute_new_members != group_call->allowed_change_mute_new_members; + auto mute_flags_changed = + call.mute_new_participants != group_call->mute_new_participants || + call.allowed_change_mute_new_participants != group_call->allowed_change_mute_new_participants; if (call.version > group_call->version) { if (group_call->channel_id.is_valid()) { - td_->contacts_manager_->on_update_channel_group_call(group_call->channel_id, true, call.member_count == 0); + td_->contacts_manager_->on_update_channel_group_call(group_call->channel_id, true, + call.participant_count == 0); } - need_update = call.member_count != group_call->member_count || mute_flags_changed; + need_update = call.participant_count != group_call->participant_count || mute_flags_changed; *group_call = std::move(call); } else if (call.version == group_call->version) { if (mute_flags_changed) { - group_call->mute_new_members = call.mute_new_members; - group_call->allowed_change_mute_new_members = call.allowed_change_mute_new_members; + group_call->mute_new_participants = call.mute_new_participants; + group_call->allowed_change_mute_new_participants = call.allowed_change_mute_new_participants; need_update = true; } } @@ -1118,7 +1120,7 @@ void GroupCallManager::on_source_speaking_in_group_call(GroupCallId group_call_i return; } - UserId user_id = get_group_call_member_by_source(group_call_id, source); + UserId user_id = get_group_call_participant_by_source(group_call_id, source); if (user_id.is_valid()) { on_user_speaking_in_group_call(group_call_id, user_id, G()->unix_time()); } else if (!recursive) { @@ -1148,7 +1150,7 @@ void GroupCallManager::on_group_call_recent_speakers_updated(const GroupCall *gr recent_speaker_update_timeout_.set_timeout_in(group_call->group_call_id.get(), MAX_RECENT_SPEAKER_UPDATE_DELAY); } -UserId GroupCallManager::get_group_call_member_by_source(GroupCallId group_call_id, int32 source) { +UserId GroupCallManager::get_group_call_participant_by_source(GroupCallId group_call_id, int32 source) { // TODO return UserId(); } @@ -1200,9 +1202,9 @@ tl_object_ptr GroupCallManager::get_group_call_object(const G CHECK(group_call->is_inited); return td_api::make_object(group_call->group_call_id.get(), group_call->is_active, - group_call->is_joined, group_call->member_count, - std::move(recent_speaker_user_ids), group_call->mute_new_members, - group_call->allowed_change_mute_new_members, group_call->duration); + group_call->is_joined, group_call->participant_count, + std::move(recent_speaker_user_ids), group_call->mute_new_participants, + group_call->allowed_change_mute_new_participants, group_call->duration); } tl_object_ptr GroupCallManager::get_update_group_call_object( diff --git a/td/telegram/GroupCallManager.h b/td/telegram/GroupCallManager.h index 1c068e62b..66e9bfe53 100644 --- a/td/telegram/GroupCallManager.h +++ b/td/telegram/GroupCallManager.h @@ -43,15 +43,16 @@ class GroupCallManager : public Actor { void join_group_call(GroupCallId group_call_id, td_api::object_ptr &&payload, int32 source, bool is_muted, Promise> &&promise); - void toggle_group_call_mute_new_members(GroupCallId group_call_id, bool mute_new_members, Promise &&promise); + void toggle_group_call_mute_new_participants(GroupCallId group_call_id, bool mute_new_participants, + Promise &&promise); - void invite_group_call_members(GroupCallId group_call_id, vector &&user_ids, Promise &&promise); + void invite_group_call_participants(GroupCallId group_call_id, vector &&user_ids, Promise &&promise); - void set_group_call_member_is_speaking(GroupCallId group_call_id, int32 source, bool is_speaking, - Promise &&promise); + void set_group_call_participant_is_speaking(GroupCallId group_call_id, int32 source, bool is_speaking, + Promise &&promise); - void toggle_group_call_member_is_muted(GroupCallId group_call_id, UserId user_id, bool is_muted, - Promise &&promise); + void toggle_group_call_participant_is_muted(GroupCallId group_call_id, UserId user_id, bool is_muted, + Promise &&promise); void check_group_call_is_joined(GroupCallId group_call_id, Promise &&promise); @@ -117,7 +118,7 @@ class GroupCallManager : public Actor { void on_group_call_recent_speakers_updated(const GroupCall *group_call, GroupCallRecentSpeakers *recent_speakers); - UserId get_group_call_member_by_source(GroupCallId group_call_id, int32 source); + UserId get_group_call_participant_by_source(GroupCallId group_call_id, int32 source); static Result> get_group_call_join_response_object( string json_response); diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 92c3ca2a0..6ee977cdb 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -4792,7 +4792,7 @@ tl_object_ptr get_message_content_object(const MessageCo } case MessageContentType::InviteToGroupCall: { auto *m = static_cast(content); - return make_tl_object( + return make_tl_object( td->group_call_manager_->get_group_call_id(m->input_group_call_id, ChannelId()).get(), td->contacts_manager_->get_user_ids_object(m->user_ids, "MessageInviteToGroupCall")); } diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 740dc2b02..7b71448c2 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6053,36 +6053,36 @@ void Td::on_request(uint64 id, td_api::joinGroupCall &request) { request.source_, request.is_muted_, std::move(promise)); } -void Td::on_request(uint64 id, const td_api::toggleGroupCallMuteNewMembers &request) { +void Td::on_request(uint64 id, const td_api::toggleGroupCallMuteNewParticipants &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); - group_call_manager_->toggle_group_call_mute_new_members(GroupCallId(request.group_call_id_), - request.mute_new_members_, std::move(promise)); + group_call_manager_->toggle_group_call_mute_new_participants(GroupCallId(request.group_call_id_), + request.mute_new_participants_, std::move(promise)); } -void Td::on_request(uint64 id, const td_api::inviteGroupCallMembers &request) { +void Td::on_request(uint64 id, const td_api::inviteGroupCallParticipants &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); vector user_ids; for (auto &user_id : request.user_ids_) { user_ids.emplace_back(user_id); } - group_call_manager_->invite_group_call_members(GroupCallId(request.group_call_id_), std::move(user_ids), - std::move(promise)); + group_call_manager_->invite_group_call_participants(GroupCallId(request.group_call_id_), std::move(user_ids), + std::move(promise)); } -void Td::on_request(uint64 id, const td_api::setGroupCallMemberIsSpeaking &request) { +void Td::on_request(uint64 id, const td_api::setGroupCallParticipantIsSpeaking &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); - group_call_manager_->set_group_call_member_is_speaking(GroupCallId(request.group_call_id_), request.source_, - request.is_speaking_, std::move(promise)); + group_call_manager_->set_group_call_participant_is_speaking(GroupCallId(request.group_call_id_), request.source_, + request.is_speaking_, std::move(promise)); } -void Td::on_request(uint64 id, const td_api::toggleGroupCallMemberIsMuted &request) { +void Td::on_request(uint64 id, const td_api::toggleGroupCallParticipantIsMuted &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); - group_call_manager_->toggle_group_call_member_is_muted(GroupCallId(request.group_call_id_), UserId(request.user_id_), - request.is_muted_, std::move(promise)); + group_call_manager_->toggle_group_call_participant_is_muted( + GroupCallId(request.group_call_id_), UserId(request.user_id_), request.is_muted_, std::move(promise)); } void Td::on_request(uint64 id, const td_api::checkGroupCallIsJoined &request) { diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 0934775a6..415168ebc 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -698,13 +698,13 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::joinGroupCall &request); - void on_request(uint64 id, const td_api::toggleGroupCallMuteNewMembers &request); + void on_request(uint64 id, const td_api::toggleGroupCallMuteNewParticipants &request); - void on_request(uint64 id, const td_api::inviteGroupCallMembers &request); + void on_request(uint64 id, const td_api::inviteGroupCallParticipants &request); - void on_request(uint64 id, const td_api::setGroupCallMemberIsSpeaking &request); + void on_request(uint64 id, const td_api::setGroupCallParticipantIsSpeaking &request); - void on_request(uint64 id, const td_api::toggleGroupCallMemberIsMuted &request); + void on_request(uint64 id, const td_api::toggleGroupCallParticipantIsMuted &request); void on_request(uint64 id, const td_api::checkGroupCallIsJoined &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 25b678886..d69780458 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2848,30 +2848,31 @@ class CliClient final : public Actor { td_api::make_object("ufrag", "pwd", std::move(fingerprints)), 123, true)); } else if (op == "jgcc") { send_request(td_api::make_object(as_group_call_id(args), nullptr, 123, true)); - } else if (op == "tgcmnm" || op == "tgcmnme") { - send_request(td_api::make_object(as_group_call_id(args), op == "tgcmnme")); - } else if (op == "sgcmis") { + } else if (op == "tgcmnp" || op == "tgcmnpe") { + send_request( + td_api::make_object(as_group_call_id(args), op == "tgcmnme")); + } else if (op == "sgcpis") { string group_call_id; string source; string is_speaking; std::tie(group_call_id, args) = split(args); std::tie(source, is_speaking) = split(args); - send_request(td_api::make_object( + send_request(td_api::make_object( as_group_call_id(group_call_id), to_integer(source), as_bool(is_speaking))); - } else if (op == "igcm") { + } else if (op == "igcp") { string group_call_id; string user_ids; std::tie(group_call_id, user_ids) = split(args); - send_request( - td_api::make_object(as_group_call_id(group_call_id), as_user_ids(user_ids))); - } else if (op == "tgcmim") { + send_request(td_api::make_object(as_group_call_id(group_call_id), + as_user_ids(user_ids))); + } else if (op == "tgcpim") { string group_call_id; string user_id; string is_muted; std::tie(group_call_id, args) = split(args); std::tie(user_id, is_muted) = split(args); - send_request(td_api::make_object(as_group_call_id(group_call_id), - as_user_id(user_id), as_bool(is_muted))); + send_request(td_api::make_object( + as_group_call_id(group_call_id), as_user_id(user_id), as_bool(is_muted))); } else if (op == "cgcij") { send_request(td_api::make_object(as_group_call_id(args))); } else if (op == "lgc") {