diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-30 17:08:43 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-11-26 11:46:43 +0300 |
commit | f3e6e5667f70300dcb0ef84546600ec2853b1108 (patch) | |
tree | f54f73757241a23a872e42ada9ab49ae062cf1c9 /lib/Controller | |
parent | d0e799b4458b6c00e2f329b9878f400440c6d759 (diff) |
Get the participant by actor
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/SignalingController.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index 08fd8572c..f40570f5f 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -520,16 +520,17 @@ class SignalingController extends OCSController { } private function backendRoom(array $roomRequest): DataResponse { - $roomId = $roomRequest['roomid']; + $token = $roomRequest['roomid']; // It's actually the room token $userId = $roomRequest['userid']; $sessionId = $roomRequest['sessionid']; $action = !empty($roomRequest['action']) ? $roomRequest['action'] : 'join'; $actorId = $roomRequest['actorid'] ?? null; $actorType = $roomRequest['actortype'] ?? null; - if ($actorId && $actorType) { + $participant = null; + if ($actorId !== null && $actorType !== null) { try { - $room = $this->manager->getRoomByActor($roomId, $actorId, $actorType); + $room = $this->manager->getRoomByActor($token, $actorType, $actorId); } catch (RoomNotFoundException $e) { return new DataResponse([ 'type' => 'error', @@ -540,14 +541,13 @@ class SignalingController extends OCSController { ]); } - $participant = null; try { - $participant = $room->getParticipant($actorId); + $participant = $room->getParticipantByActor($actorType, $actorId); } catch (ParticipantNotFoundException $e) { } } else { try { - $room = $this->manager->getRoomByToken($roomId, $userId); + $room = $this->manager->getRoomByToken($token, $userId); } catch (RoomNotFoundException $e) { return new DataResponse([ 'type' => 'error', @@ -558,7 +558,6 @@ class SignalingController extends OCSController { ]); } - $participant = null; if ($sessionId) { try { $participant = $room->getParticipantBySession($sessionId); |