diff options
author | Joas Schilling <coding@schilljs.com> | 2020-09-22 11:07:37 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-09-22 13:08:56 +0200 |
commit | 9a599f12ce266fbac430be412c4e1bdb1a4cb87e (patch) | |
tree | 336d5c578a53209e5d8be35520f397fe0aa31827 /lib/Collaboration | |
parent | 64c66e7ba18ded8129f462496de6add5e91284a3 (diff) |
Allow to preload a user when getting the room by token
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Collaboration')
-rw-r--r-- | lib/Collaboration/Resources/ConversationProvider.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Collaboration/Resources/ConversationProvider.php b/lib/Collaboration/Resources/ConversationProvider.php index 98d48dd26..4ba797130 100644 --- a/lib/Collaboration/Resources/ConversationProvider.php +++ b/lib/Collaboration/Resources/ConversationProvider.php @@ -54,8 +54,9 @@ class ConversationProvider implements IProvider { public function getResourceRichObject(IResource $resource): array { try { - $room = $this->manager->getRoomByToken($resource->getId()); $user = $this->userSession->getUser(); + $userId = $user instanceof IUser ? $user->getUID() : ''; + $room = $this->manager->getRoomByToken($resource->getId(), $userId); $iconURL = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('spreed', 'app-dark.svg')); /** @@ -68,7 +69,7 @@ class ConversationProvider implements IProvider { return [ 'type' => 'room', 'id' => $resource->getId(), - 'name' => $room->getDisplayName($user instanceof IUser ? $user->getUID() : ''), + 'name' => $room->getDisplayName($userId), 'call-type' => $this->getRoomType($room), 'iconUrl' => $iconURL, 'link' => $this->urlGenerator->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]) |