summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2021-09-28 22:00:04 -0500
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-09-30 11:34:44 +0100
commitc4bf48ee6fa4662d88a5bf682e79787851fe9cd8 (patch)
tree4f0a0ae05e6a1dcec941049997cefc4521c36209 /synapse/handlers/message.py
parentFix issue causing sending presence to ASes to fail (due to incomplete type an... (diff)
downloadsynapse-c4bf48ee6fa4662d88a5bf682e79787851fe9cd8.tar.xz
Fix event context for outliers in important MSC2716 spot (#10938)
Fix event context for outlier causing failures in all of the MSC2716
Complement tests.

The `EventContext.for_outlier` refactor happened in
https://github.com/matrix-org/synapse/pull/10883
and this spot was left out.
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index c66aefe2c4..fd861e94f8 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -952,18 +952,13 @@ class EventCreationHandler:
             depth=depth,
         )
 
-        old_state = None
-
         # Pass on the outlier property from the builder to the event
         # after it is created
         if builder.internal_metadata.outlier:
-            event.internal_metadata.outlier = builder.internal_metadata.outlier
-
-            # Calculate the state for outliers that pass in their own `auth_event_ids`
-            if auth_event_ids:
-                old_state = await self.store.get_events_as_list(auth_event_ids)
-
-        context = await self.state.compute_event_context(event, old_state=old_state)
+            event.internal_metadata.outlier = True
+            context = EventContext.for_outlier()
+        else:
+            context = await self.state.compute_event_context(event)
 
         if requester:
             context.app_service = requester.app_service