Don't add muted by admin users to recent speakers.
This commit is contained in:
parent
19502cbe15
commit
e85a83ffb7
|
@ -1093,7 +1093,7 @@ void GroupCallManager::on_send_speaking_action_timeout(GroupCallId group_call_id
|
|||
}
|
||||
|
||||
CHECK(group_call->as_dialog_id.is_valid());
|
||||
on_user_speaking_in_group_call(group_call_id, group_call->as_dialog_id, G()->unix_time());
|
||||
on_user_speaking_in_group_call(group_call_id, group_call->as_dialog_id, false, G()->unix_time());
|
||||
|
||||
pending_send_speaking_action_timeout_.add_timeout_in(group_call_id.get(), 4.0);
|
||||
|
||||
|
@ -3700,7 +3700,7 @@ void GroupCallManager::set_group_call_participant_is_speaking(GroupCallId group_
|
|||
}
|
||||
|
||||
if (is_speaking) {
|
||||
on_user_speaking_in_group_call(group_call_id, dialog_id, date, is_recursive);
|
||||
on_user_speaking_in_group_call(group_call_id, dialog_id, date, false, is_recursive);
|
||||
}
|
||||
|
||||
if (group_call->audio_source == audio_source && group_call->dialog_id.is_valid() &&
|
||||
|
@ -4500,11 +4500,12 @@ void GroupCallManager::on_participant_speaking_in_group_call(InputGroupCallId in
|
|||
return;
|
||||
}
|
||||
|
||||
on_user_speaking_in_group_call(group_call->group_call_id, participant.dialog_id, active_date, !participant.is_min);
|
||||
on_user_speaking_in_group_call(group_call->group_call_id, participant.dialog_id, participant.server_is_muted_by_admin,
|
||||
active_date, !participant.is_min);
|
||||
}
|
||||
|
||||
void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id, DialogId dialog_id, int32 date,
|
||||
bool is_recursive) {
|
||||
void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id, DialogId dialog_id,
|
||||
bool is_muted_by_admin, int32 date, bool is_recursive) {
|
||||
if (G()->close_flag()) {
|
||||
return;
|
||||
}
|
||||
|
@ -4518,6 +4519,9 @@ void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id,
|
|||
if (group_call != nullptr && group_call->is_inited && !group_call->is_active) {
|
||||
return;
|
||||
}
|
||||
if (group_call->has_hidden_listeners && is_muted_by_admin) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!td_->messages_manager_->have_dialog_info_force(dialog_id) ||
|
||||
(!is_recursive && need_group_call_participants(input_group_call_id, group_call) &&
|
||||
|
@ -4525,11 +4529,11 @@ void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id,
|
|||
if (is_recursive) {
|
||||
LOG(ERROR) << "Failed to find speaking " << dialog_id << " from " << input_group_call_id;
|
||||
} else {
|
||||
auto query_promise =
|
||||
PromiseCreator::lambda([actor_id = actor_id(this), group_call_id, dialog_id, date](Result<Unit> &&result) {
|
||||
auto query_promise = PromiseCreator::lambda(
|
||||
[actor_id = actor_id(this), group_call_id, dialog_id, is_muted_by_admin, date](Result<Unit> &&result) {
|
||||
if (!G()->close_flag() && result.is_ok()) {
|
||||
send_closure(actor_id, &GroupCallManager::on_user_speaking_in_group_call, group_call_id, dialog_id, date,
|
||||
true);
|
||||
send_closure(actor_id, &GroupCallManager::on_user_speaking_in_group_call, group_call_id, dialog_id,
|
||||
is_muted_by_admin, date, true);
|
||||
}
|
||||
});
|
||||
vector<tl_object_ptr<telegram_api::InputPeer>> input_peers;
|
||||
|
|
|
@ -128,7 +128,7 @@ class GroupCallManager final : public Actor {
|
|||
|
||||
void on_update_group_call(tl_object_ptr<telegram_api::GroupCall> group_call_ptr, DialogId dialog_id);
|
||||
|
||||
void on_user_speaking_in_group_call(GroupCallId group_call_id, DialogId dialog_id, int32 date,
|
||||
void on_user_speaking_in_group_call(GroupCallId group_call_id, DialogId dialog_id, bool is_muted_by_admin, int32 date,
|
||||
bool is_recursive = false);
|
||||
|
||||
void on_get_group_call_participants(InputGroupCallId input_group_call_id,
|
||||
|
|
|
@ -7629,7 +7629,7 @@ void MessagesManager::on_dialog_action(DialogId dialog_id, MessageId top_thread_
|
|||
const Dialog *d = get_dialog_force(dialog_id, "on_dialog_action");
|
||||
if (d != nullptr && d->active_group_call_id.is_valid()) {
|
||||
auto group_call_id = td_->group_call_manager_->get_group_call_id(d->active_group_call_id, dialog_id);
|
||||
td_->group_call_manager_->on_user_speaking_in_group_call(group_call_id, typing_dialog_id, date);
|
||||
td_->group_call_manager_->on_user_speaking_in_group_call(group_call_id, typing_dialog_id, false, date);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user