diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-21 12:54:28 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:09 +0300 |
commit | 9fed7b6760d3ecaa27337a86a4cd74e2f173d8a6 (patch) | |
tree | 9295812817ab424de0000ad84c9c51e84d5060f0 /lib/Manager.php | |
parent | f905186571c1041d410eb84501404156185bfc41 (diff) |
Fix joining as a guest and leaving a conversation as a session
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r-- | lib/Manager.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index 6ad66c2ad..5b3bdbbd2 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -570,9 +570,14 @@ class Manager { throw new RoomNotFoundException(); } - if ((string) $userId !== $row['actor_id']) { - // FIXME check the actor type too and bail out for guests - throw new RoomNotFoundException(); + if ($userId !== null) { + if ($row['actor_type'] !== 'users' || $userId !== $row['actor_id']) { + throw new RoomNotFoundException(); + } + } else { + if ($row['actor_type'] !== 'guests') { + throw new RoomNotFoundException(); + } } if ($row['token'] === null) { |