diff options
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r-- | synapse/events/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py index c890833b1d..f834d5dad8 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py @@ -64,6 +64,7 @@ def prune_event(event: EventBase) -> EventBase: the user has specified, but we do want to keep necessary information like type, state_key etc. """ + pruned_event_dict = prune_event_dict(event.room_version, event.get_dict()) from . import make_event_from_dict @@ -102,7 +103,6 @@ def prune_event_dict(room_version: RoomVersion, event_dict: JsonDict) -> JsonDic "content", "type", "state_key", - "depth", "prev_events", "auth_events", "origin_server_ts", @@ -112,6 +112,12 @@ def prune_event_dict(room_version: RoomVersion, event_dict: JsonDict) -> JsonDic if not room_version.updated_redaction_rules: allowed_keys.extend(["prev_state", "membership", "origin"]) + # The hub server should not be redacted for linear matrix. + if room_version.linearized_matrix: + allowed_keys.append("hub_server") + else: + allowed_keys.append("depth") + event_type = event_dict["type"] new_content = {} |