summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-07-25 17:13:37 +0100
committerMark Haines <mark.haines@matrix.org>2016-07-25 17:13:37 +0100
commit8f7f4cb92baa1eb8c772644e2567fe56d563b4b9 (patch)
tree3e4542dd3ab2615f92eba29ceb2cca27d0f43768 /synapse/storage/events.py
parentDon't add rejections to the state_group, persist all rejections (diff)
downloadsynapse-8f7f4cb92baa1eb8c772644e2567fe56d563b4b9.tar.xz
Don't add the events to forward extremities if the event is rejected
Diffstat (limited to '')
-rw-r--r--synapse/storage/events.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 41c9b17d14..201a4455fa 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -498,8 +498,8 @@ class EventsStore(SQLBaseStore):
                     sql,
                     (False, event.event_id,)
                 )
-
-                self._update_extremeties(txn, [event])
+                if not context.rejected:
+                    self._update_extremeties(txn, [event])
 
         events_and_contexts = [
             ec for ec in events_and_contexts if ec[0] not in to_remove
@@ -512,7 +512,10 @@ class EventsStore(SQLBaseStore):
 
         self._handle_mult_prev_events(
             txn,
-            events=[event for event, _ in events_and_contexts],
+            events=[
+                event for event, context in events_and_contexts
+                if not context.rejected
+            ],
         )
 
         for event, _ in events_and_contexts: