mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Very first cut of calculating actions for events as they come in. Doesn't store them yet. Not very efficient.
This commit is contained in:
parent
86345a511f
commit
21f135ba76
4 changed files with 81 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue