Show recently joined voice chat participants as recent speakers.

This commit is contained in:
levlam 2021-01-05 22:46:35 +03:00
parent 71ac1f67bf
commit db3875710b
2 changed files with 4 additions and 3 deletions

View File

@ -2076,7 +2076,8 @@ void GroupCallManager::on_receive_group_call_version(InputGroupCallId input_grou
void GroupCallManager::on_participant_speaking_in_group_call(InputGroupCallId input_group_call_id,
const GroupCallParticipant &participant) {
if (participant.active_date < G()->unix_time() - RECENT_SPEAKER_TIMEOUT) {
auto active_date = td::max(participant.active_date, participant.joined_date - 60);
if (active_date < G()->unix_time() - RECENT_SPEAKER_TIMEOUT) {
return;
}
@ -2085,7 +2086,7 @@ void GroupCallManager::on_participant_speaking_in_group_call(InputGroupCallId in
return;
}
on_user_speaking_in_group_call(group_call->group_call_id, participant.user_id, participant.active_date, true);
on_user_speaking_in_group_call(group_call->group_call_id, participant.user_id, active_date, true);
}
void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id, UserId user_id, int32 date,

View File

@ -88,7 +88,7 @@ class GroupCallManager : public Actor {
struct GroupCallRecentSpeakers;
struct PendingJoinRequest;
static constexpr int32 RECENT_SPEAKER_TIMEOUT = 5 * 60;
static constexpr int32 RECENT_SPEAKER_TIMEOUT = 60 * 60;
static constexpr int32 CHECK_GROUP_CALL_IS_JOINED_TIMEOUT = 10;
void tear_down() override;