summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-10 13:32:23 +0100
committerErik Johnston <erik@matrix.org>2016-08-10 13:32:23 +0100
commit739ea29d1ecbdf414db1f5062c8a2aeaa519f4ff (patch)
tree7533097634c3f84b0ff4c10776cb251ad988b04e /synapse
parentAlso pull out rejected events (diff)
downloadsynapse-739ea29d1ecbdf414db1f5062c8a2aeaa519f4ff.tar.xz
Also check if server is in the room
Diffstat (limited to '')
-rw-r--r--synapse/handlers/federation.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 2f8959db92..ff6bb475b5 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1106,11 +1106,16 @@ class FederationHandler(BaseHandler):
                 )
 
             if do_auth:
+                in_room = yield self.auth.check_host_in_room(
+                    event.room_id,
+                    origin
+                )
+                if not in_room:
+                    raise AuthError(403, "Host not in room.")
+
                 events = yield self._filter_events_for_server(
                     origin, event.room_id, [event]
                 )
-                if not events:
-                    raise AuthError(403, "Host not in room.")
 
                 event = events[0]