summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-02 13:40:07 +0100
committerErik Johnston <erik@matrix.org>2016-09-02 13:40:28 +0100
commitbd9b8d87ae08e3601631e86c54e95c7f53dd3b17 (patch)
tree17762e138e9dff197358b11f538cab6171abad52
parentMerge pull request #1061 from matrix-org/erikj/linearize_resolution (diff)
downloadsynapse-bd9b8d87ae08e3601631e86c54e95c7f53dd3b17.tar.xz
Only check if host is in room if we have state and auth_chain
-rw-r--r--synapse/handlers/federation.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 8e61d74b13..ca51044ae4 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -118,12 +118,18 @@ class FederationHandler(BaseHandler):
 
         # FIXME (erikj): Awful hack to make the case where we are not currently
         # in the room work
-        is_in_room = yield self.auth.check_host_in_room(
-            event.room_id,
-            self.server_name
-        )
-        if not is_in_room and not event.internal_metadata.is_outlier():
-            logger.debug("Got event for room we're not in.")
+        if state and auth_chain and not event.internal_metadata.is_outlier():
+            is_in_room = yield self.auth.check_host_in_room(
+                event.room_id,
+                self.server_name
+            )
+        else:
+            is_in_room = True
+        if not is_in_room:
+            logger.info(
+                "Got event for room we're not in: %r %r",
+                event.room_id, event.event_id
+            )
 
             try:
                 event_stream_id, max_stream_id = yield self._persist_auth_tree(