diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 37482f1aaa8..18b8770522a 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -231,7 +231,7 @@ public function getSingleRoom(string $token): DataResponse { $includeLastMessage = !$isSIPBridgeRequest; try { - $room = $this->manager->getRoomForUserByToken($token, $this->userId, $includeLastMessage); + $room = $this->manager->getRoomForUserByToken($token, $this->userId, $includeLastMessage, $isSIPBridgeRequest); $participant = null; try { diff --git a/lib/Manager.php b/lib/Manager.php index c4488261d7b..055eee0caf4 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -392,10 +392,11 @@ public function getRoomForUser(int $roomId, ?string $userId): Room { * @param string $token * @param string|null $userId * @param bool $includeLastMessage + * @param bool $isSIPBridgeRequest * @return Room * @throws RoomNotFoundException */ - public function getRoomForUserByToken(string $token, ?string $userId, bool $includeLastMessage = false): Room { + public function getRoomForUserByToken(string $token, ?string $userId, bool $includeLastMessage = false, bool $isSIPBridgeRequest = false): Room { $query = $this->db->getQueryBuilder(); $query->select('r.*') ->selectAlias('r.id', 'r_id') @@ -441,7 +442,7 @@ public function getRoomForUserByToken(string $token, ?string $userId, bool $incl $room->setParticipant($row['actor_id'], $this->createParticipantObject($room, $row)); } - if ($room->getType() === Room::PUBLIC_CALL) { + if ($isSIPBridgeRequest || $room->getType() === Room::PUBLIC_CALL) { return $room; }