From 52f99243ab0eef93558ddc95b744c548241057ac Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 16 Dec 2014 18:33:50 +0000 Subject: Use is_outlier() so that we don't get AttributeError --- synapse/federation/replication.py | 6 +++--- synapse/state.py | 2 +- synapse/storage/__init__.py | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'synapse') diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py index 9f8aadccca..ec9b6e246b 100644 --- a/synapse/federation/replication.py +++ b/synapse/federation/replication.py @@ -562,8 +562,8 @@ class ReplicationLayer(object): already_seen = ( existing and ( - not existing.internal_metadata.outlier - or pdu.internal_metadata.outlier + not existing.internal_metadata.is_outlier() + or pdu.internal_metadata.is_outlier() ) ) if already_seen: @@ -604,7 +604,7 @@ class ReplicationLayer(object): # ) # Get missing pdus if necessary. - if not pdu.internal_metadata.outlier: + if not pdu.internal_metadata.is_outlier(): # We only backfill backwards to the min depth. min_depth = yield self.handler.get_min_depth_for_context( pdu.room_id diff --git a/synapse/state.py b/synapse/state.py index 99f873b6e5..580053d3ff 100644 --- a/synapse/state.py +++ b/synapse/state.py @@ -79,7 +79,7 @@ class StateHandler(object): defer.returnValue(False) return - if hasattr(event, "outlier") and event.outlier: + if event.is_outlier(): event.state_group = None event.old_state_events = None event.state_events = None diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index 2a683b25f7..e236bf495b 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py @@ -143,9 +143,7 @@ class DataStore(RoomMemberStore, RoomStore, elif event.type == EventTypes.Redaction: self._store_redaction(txn, event) - outlier = False - if hasattr(event.internal_metadata, "outlier"): - outlier = event.internal_metadata.outlier + outlier = event.internal_metadata.is_outlier() event_dict = { k: v -- cgit 1.4.1