summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-12-10 16:26:08 +0000
committerDavid Baker <dave@matrix.org>2015-12-10 16:26:08 +0000
commit21f135ba763a583ecf9ba2714b5151f6b14b61fd (patch)
treeb7d2caeff94eb20bd167df49d0694e8f4168e65c /synapse/handlers/federation.py
parentMerge pull request #432 from matrix-org/pushrules_refactor (diff)
downloadsynapse-21f135ba763a583ecf9ba2714b5151f6b14b61fd.tar.xz
Very first cut of calculating actions for events as they come in. Doesn't store them yet. Not very efficient.
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 2855f2d7c3..18289eb529 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -32,10 +32,12 @@ from synapse.crypto.event_signing import (
 )
 from synapse.types import UserID
 
-from synapse.events.utils import prune_event
+from synapse.events.utils import prune_event, serialize_event
 
 from synapse.util.retryutils import NotRetryingDestination
 
+from synapse.push.action_generator import ActionGenerator
+
 from twisted.internet import defer
 
 import itertools
@@ -1113,6 +1115,11 @@ 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
@@ -1139,6 +1146,12 @@ 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