Skip to content

Commit

Permalink
fix(call): Fix call notification when being pinged again after leavin…
Browse files Browse the repository at this point in the history
…g a call

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Dec 11, 2024
1 parent 22f2374 commit 51b0b65
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Service/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,18 @@ public function checkIfUserIsMissingCall(string $token, string $userId): int {
if ($activeSince->getTimestamp() >= $row['last_joined_call']) {
return CallNotificationController::CASE_STILL_CURRENT;
}

// The participant had joined the call, but left again.
// In this case we should not ring any more, but clients stop
// pinging the endpoint 45s after receiving the push anyway.
// However, it is also possible that the participant was ringed
// again by a moderator after they had joined the call before.
// So if a client pings the endpoint after 45s initial ringing
// + 15 seconds for worst case push notification delay, we will
// again tell them to show the call notification.
if (($activeSince->getTimestamp() + 45 + 15) < $this->timeFactory->getTime()) {
return CallNotificationController::CASE_STILL_CURRENT;
}
return CallNotificationController::CASE_PARTICIPANT_JOINED;
}

Expand Down

0 comments on commit 51b0b65

Please sign in to comment.