From a84a6933274c0da64c41ac494b027ab5010a4801 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 10 Dec 2015 17:18:46 +0000 Subject: [PATCH] Having consulted The Erikle, this should go at the end of on_receive_pdu, otherwise it will be triggered whenever we backfill too. --- synapse/handlers/federation.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 18289eb52..6a4269b50 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -244,6 +244,12 @@ class FederationHandler(BaseHandler): user = UserID.from_string(event.state_key) yield user_joined_room(self.distributor, user, event.room_id) + if not backfilled and not event.internal_metadata.is_outlier(): + action_generator = ActionGenerator(self.store) + yield action_generator.handle_event(serialize_event( + event, self.clock.time_msec()) + ) + @defer.inlineCallbacks def _filter_events_for_server(self, server_name, room_id, events): event_to_state = yield self.store.get_state_for_events( @@ -1115,11 +1121,6 @@ class FederationHandler(BaseHandler): current_state=current_state, ) - action_generator = ActionGenerator(self.store) - yield action_generator.handle_event(serialize_event( - event, self.clock.time_msec()) - ) - defer.returnValue((context, event_stream_id, max_stream_id)) @defer.inlineCallbacks @@ -1146,12 +1147,6 @@ class FederationHandler(BaseHandler): is_new_state=(not outliers and not backfilled), ) - for ev_info in event_infos: - action_generator = ActionGenerator(self.store) - yield action_generator.handle_event(serialize_event( - ev_info["event"], self.clock.time_msec()) - ) - @defer.inlineCallbacks def _persist_auth_tree(self, auth_events, state, event): """Checks the auth chain is valid (and passes auth checks) for the