Skip to content

Commit 58c099d

Browse files
nickvergessenbackportbot[bot]
authored andcommitted
fix(signaling): Check recipient room with internal signaling
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent c3d0fc2 commit 58c099d

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

lib/Controller/SignalingController.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,20 @@ public function sendMessages(string $token, string $messages): DataResponse {
319319
}
320320
$decodedMessage['from'] = $message['sessionId'];
321321

322-
if ($decodedMessage['type'] === 'control') {
323-
$room = $this->manager->getRoomForSession($this->userId, $message['sessionId']);
324-
$participant = $this->participantService->getParticipantBySession($room, $message['sessionId']);
322+
$room = $this->manager->getRoomForSession($this->userId, $message['sessionId']);
323+
$participant = $this->participantService->getParticipantBySession($room, $message['sessionId']);
324+
try {
325+
$this->participantService->getParticipantBySession($room, $decodedMessage['to']);
326+
} catch (ParticipantNotFoundException) {
327+
break;
328+
}
325329

330+
331+
if ($decodedMessage['type'] === 'control') {
326332
if (!$participant->hasModeratorPermissions(false)) {
327333
break;
328334
}
329335
} elseif ($decodedMessage['type'] === 'offer' || $decodedMessage['type'] === 'answer') {
330-
$room = $this->manager->getRoomForSession($this->userId, $message['sessionId']);
331-
$participant = $this->participantService->getParticipantBySession($room, $message['sessionId']);
332-
333336
if (!($participant->getPermissions() & Attendee::PERMISSIONS_PUBLISH_AUDIO) && $decodedMessage['roomType'] === 'video'
334337
&& $this->isTryingToPublishMedia($decodedMessage['payload']['sdp'], 'audio')) {
335338
break;

0 commit comments

Comments
 (0)