Skip to content

Commit

Permalink
Show recently joined voice chat participants as recent speakers.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Jan 5, 2021
1 parent 71ac1f6 commit db38757
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions td/telegram/GroupCallManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/GroupCallManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db38757

Please sign in to comment.