Add separate GroupCallManager::on_update_group_call_rights method.

This commit is contained in:
levlam 2020-12-17 18:27:01 +03:00
parent 7a6c393b7b
commit 2a50685321
3 changed files with 10 additions and 4 deletions

View File

@ -698,9 +698,8 @@ void GroupCallManager::get_group_call(GroupCallId group_call_id,
reload_group_call(input_group_call_id, std::move(promise));
}
void GroupCallManager::reload_group_call(InputGroupCallId input_group_call_id,
Promise<td_api::object_ptr<td_api::groupCall>> &&promise) {
if (!promise && need_group_call_participants(input_group_call_id)) {
void GroupCallManager::on_update_group_call_rights(InputGroupCallId input_group_call_id) {
if (need_group_call_participants(input_group_call_id)) {
auto group_call = get_group_call(input_group_call_id);
CHECK(group_call != nullptr && group_call->is_inited);
try_load_group_call_administrators(input_group_call_id, group_call->dialog_id);
@ -713,6 +712,11 @@ void GroupCallManager::reload_group_call(InputGroupCallId input_group_call_id,
}
}
reload_group_call(input_group_call_id, Auto());
}
void GroupCallManager::reload_group_call(InputGroupCallId input_group_call_id,
Promise<td_api::object_ptr<td_api::groupCall>> &&promise) {
auto &queries = load_group_call_queries_[input_group_call_id];
queries.push_back(std::move(promise));
if (queries.size() == 1) {

View File

@ -41,6 +41,8 @@ class GroupCallManager : public Actor {
void get_group_call(GroupCallId group_call_id, Promise<td_api::object_ptr<td_api::groupCall>> &&promise);
void on_update_group_call_rights(InputGroupCallId input_group_call_id);
void reload_group_call(InputGroupCallId input_group_call_id,
Promise<td_api::object_ptr<td_api::groupCall>> &&promise);

View File

@ -10663,7 +10663,7 @@ void MessagesManager::reload_dialog_group_call(DialogId dialog_id) {
}
if (d->active_group_call_id.is_valid()) {
td_->group_call_manager_->reload_group_call(d->active_group_call_id, Auto());
td_->group_call_manager_->on_update_group_call_rights(d->active_group_call_id);
}
}