Add GroupCallManager::send_update_group_call.

This commit is contained in:
levlam 2020-12-06 21:22:55 +03:00
parent b0806df48f
commit 1d60bf36e6
2 changed files with 10 additions and 4 deletions

View File

@ -446,7 +446,7 @@ void GroupCallManager::on_recent_speaker_update_timeout(GroupCallId group_call_i
} }
} }
send_closure(G()->td(), &Td::send_update, get_update_group_call_object(group_call)); send_update_group_call(group_call);
} }
GroupCallId GroupCallManager::get_group_call_id(InputGroupCallId input_group_call_id, ChannelId channel_id) { GroupCallId GroupCallManager::get_group_call_id(InputGroupCallId input_group_call_id, ChannelId channel_id) {
@ -878,7 +878,7 @@ void GroupCallManager::on_group_call_left(InputGroupCallId input_group_call_id,
group_call->is_joined = false; group_call->is_joined = false;
group_call->is_speaking = false; group_call->is_speaking = false;
group_call->source = 0; group_call->source = 0;
send_closure(G()->td(), &Td::send_update, get_update_group_call_object(group_call)); send_update_group_call(group_call);
} }
} }
@ -987,7 +987,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
need_update |= on_join_group_call_response(call_id, std::move(join_params)); need_update |= on_join_group_call_response(call_id, std::move(join_params));
} }
if (need_update) { if (need_update) {
send_closure(G()->td(), &Td::send_update, get_update_group_call_object(group_call)); send_update_group_call(group_call);
} }
return call_id; return call_id;
} }
@ -1088,7 +1088,7 @@ tl_object_ptr<td_api::groupCall> GroupCallManager::get_group_call_object(const G
if (!for_update) { if (!for_update) {
// the change must be received through update first // the change must be received through update first
send_closure(G()->td(), &Td::send_update, get_update_group_call_object(group_call)); send_update_group_call(group_call);
} }
} }
} }
@ -1104,4 +1104,8 @@ tl_object_ptr<td_api::updateGroupCall> GroupCallManager::get_update_group_call_o
return td_api::make_object<td_api::updateGroupCall>(get_group_call_object(group_call, true)); return td_api::make_object<td_api::updateGroupCall>(get_group_call_object(group_call, true));
} }
void GroupCallManager::send_update_group_call(const GroupCall *group_call) const {
send_closure(G()->td(), &Td::send_update, get_update_group_call_object(group_call));
}
} // namespace td } // namespace td

View File

@ -116,6 +116,8 @@ class GroupCallManager : public Actor {
tl_object_ptr<td_api::groupCall> get_group_call_object(const GroupCall *group_call, bool for_update = false) const; tl_object_ptr<td_api::groupCall> get_group_call_object(const GroupCall *group_call, bool for_update = false) const;
void send_update_group_call(const GroupCall *group_call) const;
Td *td_; Td *td_;
ActorShared<> parent_; ActorShared<> parent_;