diff options
author | Joas Schilling <coding@schilljs.com> | 2021-02-10 19:59:05 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-02-11 20:56:36 +0300 |
commit | 4a1fc78a67b06cdf0c1fe7d8452d038f089ccd51 (patch) | |
tree | c8d762dbaf5db453e5c7cff203c6c80f64415eb8 | |
parent | 63ad8bbe143305499344295a2756aab087ed43e4 (diff) |
Use the cached display name for participant list instead of the user manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/Controller/RoomController.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 92a5d1855..458db8c8e 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1161,11 +1161,6 @@ class RoomController extends AEnvironmentAwareController { if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS) { $userId = $participant->getAttendee()->getActorId(); - $user = $this->userManager->get($userId); - if (!$user instanceof IUser) { - continue; - } - if ($result['lastPing'] > 0 && $result['lastPing'] <= $maxPingAge) { $this->participantService->leaveRoomAsSession($this->room, $participant); } @@ -1173,7 +1168,14 @@ class RoomController extends AEnvironmentAwareController { if ($this->getAPIVersion() < 3) { $result['userId'] = $participant->getAttendee()->getActorId(); } - $result['displayName'] = (string) $user->getDisplayName(); + $result['displayName'] = $participant->getAttendee()->getDisplayName(); + if (!$result['displayName']) { + $user = $this->userManager->get($userId); + if (!$user instanceof IUser) { + continue; + } + $result['displayName'] = $user->getDisplayName(); + } if (isset($statuses[$userId])) { $result['status'] = $statuses[$userId]->getStatus(); |