summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-02 10:19:38 +0100
committerErik Johnston <erik@matrix.org>2015-06-02 10:19:38 +0100
commitfde0da6f19aeb6dee26fc0b89fcee9d27a50b8f4 (patch)
tree6c4c2189cbfd3f7a1d9b3f8a893465d95266a655
parentDon't process events we've already processed. Remember to process state events (diff)
downloadsynapse-fde0da6f19aeb6dee26fc0b89fcee9d27a50b8f4.tar.xz
Correctly look up auth_events
-rw-r--r--synapse/handlers/federation.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index acbb53d6c5..5cd853d85e 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -271,9 +271,10 @@ class FederationHandler(BaseHandler):
                 self._handle_new_event(
                     dest, a,
                     auth_events={
-                        (e.type, e.state_key): e for e in auth_events
-                        if e.event_id in [a_id for a_id, _ in a.auth_events]
-                    }
+                        (auth_events[a_id].type, auth_events[a_id].state_key):
+                        auth_events[a_id]
+                        for a_id, _ in a.auth_events
+                    },
                 )
                 for a in auth_events.values()
                 if a.event_id not in seen_events
@@ -286,9 +287,10 @@ class FederationHandler(BaseHandler):
                 self._handle_new_event(
                     dest, s,
                     auth_events={
-                        (e.type, e.state_key): e for e in auth_events
-                        if e.event_id in [a_id for a_id, _ in s.auth_events]
-                    }
+                        (auth_events[a_id].type, auth_events[a_id].state_key):
+                        auth_events[a_id]
+                        for a_id, _ in s.auth_events
+                    },
                 )
                 for s in state_events.values()
                 if s.event_id not in seen_events
@@ -303,9 +305,10 @@ class FederationHandler(BaseHandler):
                     state=events_to_state[e_id],
                     backfilled=True,
                     auth_events={
-                        (e.type, e.state_key): e for e in auth_events
-                        if e.event_id in [a_id for a_id, _ in a.auth_events]
-                    }
+                        (auth_events[a_id].type, auth_events[a_id].state_key):
+                        auth_events[a_id]
+                        for a_id, _ in event_map[e_id].auth_events
+                    },
                 )
                 for e_id in events_to_state
             ],