summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-26 16:29:03 +0000
committerErik Johnston <erik@matrix.org>2014-11-26 16:29:03 +0000
commit858e87ab0d1bd88fcd5c819c482a40130e571874 (patch)
tree941efe1193a4207c65b0c9ea3f1f2cd32c898ab4 /synapse
parentCatch exceptions when trying to add an entry to rooms tables (diff)
downloadsynapse-858e87ab0d1bd88fcd5c819c482a40130e571874.tar.xz
Add a workaround for bug where some initial join events don't reference creation events in their auth_events
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/federation.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 5c6ed28e62..fcef602055 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -21,7 +21,7 @@ from synapse.api.events.utils import prune_event
 from synapse.api.errors import (
     AuthError, FederationError, SynapseError, StoreError,
 )
-from synapse.api.events.room import RoomMemberEvent
+from synapse.api.events.room import RoomMemberEvent, RoomCreateEvent
 from synapse.api.constants import Membership
 from synapse.util.logutils import log_function
 from synapse.util.async import run_on_reactor
@@ -618,6 +618,12 @@ class FederationHandler(BaseHandler):
 
                 auth_events[(e.type, e.state_key)] = e
 
+            if event.type == RoomMemberEvent.TYPE and not event.auth_events:
+                if len(event.prev_events) == 1:
+                    c = yield self.store.get_event(event.prev_events[0][0])
+                    if c.type == RoomCreateEvent.TYPE:
+                        auth_events[(c.type, c.state_key)] = c
+
         self.auth.check(event, auth_events=auth_events)
 
         yield self.store.persist_event(