Skip to content

Commit

Permalink
Merge pull request #3791 from nextcloud/backport/3789/stable19
Browse files Browse the repository at this point in the history
[stable19] Fix user timeout with numeric ids
  • Loading branch information
nickvergessen authored Jun 10, 2020
2 parents 0d80c0b + c50be21 commit 06fdd1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,17 +848,18 @@ public function getParticipants(): DataResponse {
$results = [];

foreach ($participants['users'] as $userId => $participant) {
$userId = (string) $userId;
if ($participant['sessionId'] !== '0' && $participant['lastPing'] <= $maxPingAge) {
$this->room->leaveRoom($userId);
}

$user = $this->userManager->get((string) $userId);
$user = $this->userManager->get($userId);
if (!$user instanceof IUser) {
continue;
}

$results[] = array_merge($participant, [
'userId' => (string) $userId,
'userId' => $userId,
'displayName' => (string) $user->getDisplayName(),
]);
}
Expand Down

0 comments on commit 06fdd1d

Please sign in to comment.