summaryrefslogtreecommitdiffstats
path: root/lib/Middleware
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-10-23 13:59:16 +0200
committerJoas Schilling <coding@schilljs.com>2020-10-30 10:38:49 +0100
commit1acb100d3abf6dcb604f0a8a9057f99d86c15871 (patch)
tree6667aad4416c14d35349df8919a0dfdcd80d1d38 /lib/Middleware
parentad6a3ae7cb8a244ca70f62ccaef7247cdbb348f0 (diff)
Fix session handling so lobby can kick you correctly
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Middleware')
-rw-r--r--lib/Middleware/InjectionMiddleware.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Middleware/InjectionMiddleware.php b/lib/Middleware/InjectionMiddleware.php
index 5ef6d17ba..3e12c8484 100644
--- a/lib/Middleware/InjectionMiddleware.php
+++ b/lib/Middleware/InjectionMiddleware.php
@@ -139,11 +139,11 @@ class InjectionMiddleware extends Middleware {
$room = $this->manager->getRoomForUserByToken($token, $this->userId);
$controller->setRoom($room);
- if ($this->userId !== null) {
- $participant = $room->getParticipant($this->userId);
- } else {
- $sessionId = $this->talkSession->getSessionForRoom($token);
+ $sessionId = $this->talkSession->getSessionForRoom($token);
+ if ($sessionId !== null) {
$participant = $room->getParticipantBySession($sessionId);
+ } else {
+ $participant = $room->getParticipant($this->userId);
}
$controller->setParticipant($participant);