|
|
|
@ -492,15 +492,6 @@ class ApiController extends Controller { |
|
|
|
* @return JSONResponse |
|
|
|
*/ |
|
|
|
public function joinRoom($roomId) { |
|
|
|
if ($roomId === 0) { |
|
|
|
if ($this->userId !== null) { |
|
|
|
$this->manager->disconnectUserFromAllRooms($this->userId); |
|
|
|
} |
|
|
|
|
|
|
|
$this->session->remove('spreed-session'); |
|
|
|
return new JSONResponse([]); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
$room = $this->manager->getRoomForParticipant($roomId, $this->userId); |
|
|
|
} catch (RoomNotFoundException $e) { |
|
|
|
@ -530,6 +521,24 @@ class ApiController extends Controller { |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @PublicPage |
|
|
|
* @UseSession |
|
|
|
* |
|
|
|
* @return JSONResponse |
|
|
|
*/ |
|
|
|
public function leave() { |
|
|
|
if ($this->userId !== null) { |
|
|
|
$this->manager->disconnectUserFromAllRooms($this->userId); |
|
|
|
} else { |
|
|
|
$sessionId = $this->session->get('spreed-session'); |
|
|
|
$this->manager->removeSessionFromAllRooms($sessionId); |
|
|
|
} |
|
|
|
|
|
|
|
$this->session->remove('spreed-session'); |
|
|
|
return new JSONResponse(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param IUser $actor |
|
|
|
* @param IUser $user |
|
|
|
|