diff options
author | Erik Johnston <erik@matrix.org> | 2014-12-16 18:35:46 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-12-16 18:35:46 +0000 |
commit | f76269392b17d2dbabc85579300d9eef9a559d4e (patch) | |
tree | 94036377e17568e6983d6aeb2a73b827a277a580 /synapse/handlers/federation.py | |
parent | Use is_outlier() so that we don't get AttributeError (diff) | |
parent | Merge branch 'release-v0.6.0' into develop (diff) | |
download | synapse-f76269392b17d2dbabc85579300d9eef9a559d4e.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.6.0
Conflicts: synapse/state.py
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 16a104c0e2..4aec3563ac 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -17,7 +17,6 @@ from ._base import BaseHandler -from synapse.events.snapshot import EventContext from synapse.events.utils import prune_event from synapse.api.errors import ( AuthError, FederationError, SynapseError, StoreError, @@ -202,7 +201,7 @@ class FederationHandler(BaseHandler): e.msg, affected=event.event_id, ) - + # if we're receiving valid events from an origin, # it's probably a good idea to mark it as not in retry-state # for sending (although this is a bit of a leap) @@ -260,12 +259,9 @@ class FederationHandler(BaseHandler): event = pdu # FIXME (erikj): Not sure this actually works :/ - context = EventContext() - yield self.state_handler.annotate_context_with_state(event, context) + context = yield self.state_handler.compute_event_context(event) - events.append( - (event, context) - ) + events.append((event, context)) yield self.store.persist_event( event, @@ -547,8 +543,6 @@ class FederationHandler(BaseHandler): """ event = pdu - context = EventContext() - event.internal_metadata.outlier = True event.signatures.update( @@ -559,7 +553,7 @@ class FederationHandler(BaseHandler): ) ) - yield self.state_handler.annotate_context_with_state(event, context) + context = yield self.state_handler.compute_event_context(event) yield self.store.persist_event( event, @@ -685,17 +679,14 @@ class FederationHandler(BaseHandler): @defer.inlineCallbacks def _handle_new_event(self, event, state=None, backfilled=False, current_state=None, fetch_missing=True): - context = EventContext() logger.debug( "_handle_new_event: Before annotate: %s, sigs: %s", event.event_id, event.signatures, ) - yield self.state_handler.annotate_context_with_state( - event, - context, - old_state=state + context = yield self.state_handler.compute_event_context( + event, old_state=state ) logger.debug( |