Remove unneeded td_api::getGroupCallMediaChannelDescriptions.
This commit is contained in:
parent
84cf82583e
commit
843df9e1f7
@ -2199,12 +2199,6 @@ groupCallParticipantVideoInfo source_groups:vector<groupCallVideoSourceGroup> en
|
||||
//@order User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list
|
||||
groupCallParticipant participant_id:MessageSender audio_source_id:int32 can_enable_video:Bool video_info:groupCallParticipantVideoInfo screen_sharing_video_info:groupCallParticipantVideoInfo bio:string is_current_user:Bool is_speaking:Bool is_hand_raised:Bool can_be_muted_for_all_users:Bool can_be_unmuted_for_all_users:Bool can_be_muted_for_current_user:Bool can_be_unmuted_for_current_user:Bool is_muted_for_all_users:Bool is_muted_for_current_user:Bool can_unmute_self:Bool volume_level:int32 order:string = GroupCallParticipant;
|
||||
|
||||
//@description Describes a media channel in a group call @source_id Channel's synchronization source identifier @is_video True if the channel is a video channel @param_description Description of the channel
|
||||
groupCallMediaChannelDescription source_id:int32 is_video:Bool description:string = GroupCallMediaChannelDescription;
|
||||
|
||||
//@description Represents a list of group call media channel description @descriptions List of descriptions
|
||||
groupCallMediaChannelDescriptions descriptions:vector<groupCallMediaChannelDescription> = GroupCallMediaChannelDescriptions;
|
||||
|
||||
|
||||
//@class CallProblem @description Describes the exact type of a problem with a call
|
||||
|
||||
@ -4781,9 +4775,6 @@ toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok;
|
||||
//@description Toggles whether current user's video is enabled @group_call_id Group call identifier @is_my_video_enabled Pass true if the current user's video is enabled
|
||||
toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok;
|
||||
|
||||
//@description Returns information about group call media channels by their synchronization source identifiers @group_call_id Group call identifier @source_ids Synchronization source identifiers
|
||||
getGroupCallMediaChannelDescriptions group_call_id:int32 source_ids:vector<int32> = GroupCallMediaChannelDescriptions;
|
||||
|
||||
//@description Informs TDLib that speaking state of a participant of an active group has changed @group_call_id Group call identifier
|
||||
//@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user @is_speaking True, if the user is speaking
|
||||
setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = Ok;
|
||||
|
@ -3457,94 +3457,6 @@ void GroupCallManager::on_toggle_group_call_recording(InputGroupCallId input_gro
|
||||
}
|
||||
}
|
||||
|
||||
void GroupCallManager::get_group_call_media_channel_descriptions(
|
||||
GroupCallId group_call_id, vector<int32> source_ids,
|
||||
Promise<td_api::object_ptr<td_api::groupCallMediaChannelDescriptions>> &&promise, bool is_recursive) {
|
||||
if (G()->close_flag()) {
|
||||
return promise.set_error(Status::Error(500, "Request aborted"));
|
||||
}
|
||||
|
||||
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);
|
||||
if (group_call == nullptr || !group_call->is_inited || !group_call->is_active) {
|
||||
return promise.set_error(Status::Error(400, "GROUPCALL_JOIN_MISSING"));
|
||||
}
|
||||
if (!group_call->is_joined) {
|
||||
if (is_group_call_being_joined(input_group_call_id) || group_call->need_rejoin) {
|
||||
group_call->after_join.push_back(
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), group_call_id, source_ids = std::move(source_ids),
|
||||
promise = std::move(promise), is_recursive](Result<Unit> &&result) mutable {
|
||||
if (result.is_error()) {
|
||||
promise.set_error(result.move_as_error());
|
||||
} else {
|
||||
send_closure(actor_id, &GroupCallManager::get_group_call_media_channel_descriptions, group_call_id,
|
||||
std::move(source_ids), std::move(promise), is_recursive);
|
||||
}
|
||||
}));
|
||||
return;
|
||||
}
|
||||
return promise.set_error(Status::Error(400, "GROUPCALL_JOIN_MISSING"));
|
||||
}
|
||||
|
||||
vector<td_api::object_ptr<td_api::groupCallMediaChannelDescription>> result;
|
||||
std::unordered_set<int32> source_ids_set(source_ids.begin(), source_ids.end());
|
||||
auto participants = add_group_call_participants(input_group_call_id);
|
||||
for (auto &participant : participants->participants) {
|
||||
if (source_ids_set.empty()) {
|
||||
break;
|
||||
}
|
||||
if (source_ids_set.count(participant.audio_source)) {
|
||||
source_ids_set.erase(participant.audio_source);
|
||||
result.push_back(
|
||||
td_api::make_object<td_api::groupCallMediaChannelDescription>(participant.audio_source, false, string()));
|
||||
}
|
||||
for (auto &group : participant.video_payload.source_groups) {
|
||||
for (auto &source_id : group.source_ids) {
|
||||
if (source_ids_set.count(source_id)) {
|
||||
source_ids_set.erase(source_id);
|
||||
result.push_back(td_api::make_object<td_api::groupCallMediaChannelDescription>(source_id, true, string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto &group : participant.presentation_payload.source_groups) {
|
||||
for (auto &source_id : group.source_ids) {
|
||||
if (source_ids_set.count(source_id)) {
|
||||
source_ids_set.erase(source_id);
|
||||
result.push_back(td_api::make_object<td_api::groupCallMediaChannelDescription>(source_id, true, string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!source_ids_set.empty()) {
|
||||
vector<int32> missing_source_ids(source_ids_set.begin(), source_ids_set.end());
|
||||
if (!is_recursive) {
|
||||
auto query_promise =
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), group_call_id, source_ids = std::move(source_ids),
|
||||
promise = std::move(promise)](Result<Unit> &&result) mutable {
|
||||
if (G()->close_flag()) {
|
||||
return promise.set_error(Status::Error(500, "Request aborted"));
|
||||
}
|
||||
if (result.is_error()) {
|
||||
promise.set_error(result.move_as_error());
|
||||
} else {
|
||||
send_closure(actor_id, &GroupCallManager::get_group_call_media_channel_descriptions, group_call_id,
|
||||
std::move(source_ids), std::move(promise), true);
|
||||
}
|
||||
});
|
||||
td_->create_handler<GetGroupCallParticipantQuery>(std::move(query_promise))
|
||||
->send(input_group_call_id, {}, std::move(missing_source_ids));
|
||||
return;
|
||||
} else {
|
||||
LOG(INFO) << "Failed to find participants with sources " << missing_source_ids << " in " << group_call_id
|
||||
<< " from " << group_call->dialog_id;
|
||||
}
|
||||
}
|
||||
|
||||
promise.set_value(td_api::make_object<td_api::groupCallMediaChannelDescriptions>(std::move(result)));
|
||||
}
|
||||
|
||||
void GroupCallManager::set_group_call_participant_is_speaking(GroupCallId group_call_id, int32 audio_source,
|
||||
bool is_speaking, Promise<Unit> &&promise, int32 date) {
|
||||
if (G()->close_flag()) {
|
||||
|
@ -95,10 +95,6 @@ class GroupCallManager : public Actor {
|
||||
|
||||
void toggle_group_call_recording(GroupCallId group_call_id, bool is_enabled, string title, Promise<Unit> &&promise);
|
||||
|
||||
void get_group_call_media_channel_descriptions(
|
||||
GroupCallId group_call_id, vector<int32> source_ids,
|
||||
Promise<td_api::object_ptr<td_api::groupCallMediaChannelDescriptions>> &&promise, bool is_recursive = false);
|
||||
|
||||
void set_group_call_participant_is_speaking(GroupCallId group_call_id, int32 audio_source, bool is_speaking,
|
||||
Promise<Unit> &&promise, int32 date = 0);
|
||||
|
||||
|
@ -6141,13 +6141,6 @@ void Td::on_request(uint64 id, const td_api::toggleGroupCallIsMyVideoEnabled &re
|
||||
request.is_my_video_enabled_, std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::getGroupCallMediaChannelDescriptions &request) {
|
||||
CHECK_IS_USER();
|
||||
CREATE_REQUEST_PROMISE();
|
||||
group_call_manager_->get_group_call_media_channel_descriptions(GroupCallId(request.group_call_id_),
|
||||
std::move(request.source_ids_), std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, const td_api::setGroupCallParticipantIsSpeaking &request) {
|
||||
CHECK_IS_USER();
|
||||
CREATE_OK_REQUEST_PROMISE();
|
||||
|
@ -742,8 +742,6 @@ class Td final : public NetQueryCallback {
|
||||
|
||||
void on_request(uint64 id, const td_api::toggleGroupCallIsMyVideoEnabled &request);
|
||||
|
||||
void on_request(uint64 id, td_api::getGroupCallMediaChannelDescriptions &request);
|
||||
|
||||
void on_request(uint64 id, const td_api::setGroupCallParticipantIsSpeaking &request);
|
||||
|
||||
void on_request(uint64 id, const td_api::toggleGroupCallParticipantIsMuted &request);
|
||||
|
@ -2812,12 +2812,6 @@ class CliClient final : public Actor {
|
||||
get_args(args, group_call_id, is_my_video_enabled);
|
||||
send_request(td_api::make_object<td_api::toggleGroupCallIsMyVideoEnabled>(as_group_call_id(group_call_id),
|
||||
is_my_video_enabled));
|
||||
} else if (op == "ggcmcd") {
|
||||
string group_call_id;
|
||||
string source_ids;
|
||||
get_args(args, group_call_id, source_ids);
|
||||
send_request(td_api::make_object<td_api::getGroupCallMediaChannelDescriptions>(as_group_call_id(group_call_id),
|
||||
to_integers<int32>(source_ids)));
|
||||
} else if (op == "sgcpis") {
|
||||
string group_call_id;
|
||||
int32 source_id;
|
||||
|
Loading…
Reference in New Issue
Block a user