summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py4
-rw-r--r--synapse/handlers/room.py8
2 files changed, 7 insertions, 5 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index d26975a88a..d0de6fd04d 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -617,8 +617,8 @@ class FederationHandler(BaseHandler):
 
     @defer.inlineCallbacks
     @log_function
-    def on_backfill_request(self, origin, context, pdu_list, limit):
-        in_room = yield self.auth.check_host_in_room(context, origin)
+    def on_backfill_request(self, origin, room_id, pdu_list, limit):
+        in_room = yield self.auth.check_host_in_room(room_id, origin)
         if not in_room:
             raise AuthError(403, "Host not in room.")
 
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