summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-01-07 15:16:31 +0000
committerKegan Dougal <kegan@matrix.org>2015-01-07 15:21:48 +0000
commit9cb4f75d53d99634e79e791de22cb7de718248d6 (patch)
treeddaec5717f7348800bbc641b6ab421ec1aa8a8ad /synapse/handlers/room.py
parent*cough* (diff)
downloadsynapse-9cb4f75d53d99634e79e791de22cb7de718248d6.tar.xz
SYN-154: Better error messages when joining an unknown room by ID.
The simple fix doesn't work here because room creation also involves
unknown room IDs. The check relies on the presence of m.room.create for
rooms being created, whereas bogus room IDs have no state events at all.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 59719a1fae..3cb7e324fc 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -423,12 +423,13 @@ class RoomMemberHandler(BaseHandler):
 
         is_host_in_room = yield self.auth.check_host_in_room(
             event.room_id,
-            self.hs.hostname
+            self.hs.hostname,
+            context=context
         )
 
         if is_host_in_room:
             should_do_dance = False
-        elif room_host:
+        elif room_host:  # TODO: Shouldn't this be remote_room_host?
             should_do_dance = True
         else:
             # TODO(markjh): get prev_state from snapshot
@@ -442,7 +443,8 @@ class RoomMemberHandler(BaseHandler):
                 should_do_dance = not self.hs.is_mine(inviter)
                 room_host = inviter.domain
             else:
-                should_do_dance = False
+                # return the same error as join_room_alias does
+                raise SynapseError(404, "No known servers")
 
         if should_do_dance:
             handler = self.hs.get_handlers().federation_handler