summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-03-17 12:33:18 +0000
committerGitHub <noreply@github.com>2021-03-17 12:33:18 +0000
commit567f88f835a55d2241cc129ac44b8b0dcedfa6e2 (patch)
tree0f21914aebcaef0735edb3a585b200e0651edb90 /synapse/events/utils.py
parentAdd type hints to the room member handler. (#9631) (diff)
downloadsynapse-567f88f835a55d2241cc129ac44b8b0dcedfa6e2.tar.xz
Prep work for removing `outlier` from `internal_metadata` (#9411)
* Populate `internal_metadata.outlier` based on `events` table

Rather than relying on `outlier` being in the `internal_metadata` column,
populate it based on the `events.outlier` column.

* Move `outlier` out of InternalMetadata._dict

Ultimately, this will allow us to stop writing it to the database. For now, we
have to grandfather it back in so as to maintain compatibility with older
versions of Synapse.
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index 7ca5c9940a..5022e0fcb3 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -54,6 +54,8 @@ def prune_event(event: EventBase) -> EventBase:
         event.internal_metadata.stream_ordering
     )
 
+    pruned_event.internal_metadata.outlier = event.internal_metadata.outlier
+
     # Mark the event as redacted
     pruned_event.internal_metadata.redacted = True