Load even known group call participant after receiving typing from them.

This commit is contained in:
levlam 2021-02-01 02:43:23 +03:00
parent 41f6003b09
commit a29f4b43d4
2 changed files with 16 additions and 1 deletions

View File

@ -967,6 +967,16 @@ GroupCallManager::GroupCallParticipants *GroupCallManager::add_group_call_partic
return participants.get();
}
const GroupCallParticipant *GroupCallManager::get_group_call_participant(
const GroupCallParticipants *group_call_participants, UserId user_id) {
for (auto &group_call_participant : group_call_participants->participants) {
if (group_call_participant.user_id == user_id) {
return &group_call_participant;
}
}
return nullptr;
}
void GroupCallManager::on_update_group_call_participants(
InputGroupCallId input_group_call_id, vector<tl_object_ptr<telegram_api::groupCallParticipant>> &&participants,
int32 version) {
@ -2114,7 +2124,9 @@ void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id,
return;
}
if (!td_->contacts_manager_->have_user_force(user_id)) {
if (!td_->contacts_manager_->have_user_force(user_id) ||
(!recursive && need_group_call_participants(input_group_call_id, group_call) &&
get_group_call_participant(add_group_call_participants(input_group_call_id), user_id) == nullptr)) {
if (recursive) {
LOG(ERROR) << "Failed to find speaking " << user_id << " from " << input_group_call_id;
} else {

View File

@ -167,6 +167,9 @@ class GroupCallManager : public Actor {
GroupCallParticipants *add_group_call_participants(InputGroupCallId input_group_call_id);
const GroupCallParticipant *get_group_call_participant(const GroupCallParticipants *group_call_participants,
UserId user_id);
void on_group_call_left(InputGroupCallId input_group_call_id, int32 audio_source, bool need_rejoin);
void on_group_call_left_impl(GroupCall *group_call, bool need_rejoin);