summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-08-17 14:35:20 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-08-17 14:35:20 +0100
commit18572fddcc5bbcecabdcfbc69c8e8d4a1e9a1a1b (patch)
treedb096f4421fc900d6b98f41e7a1401982cd83171 /synapse/events/utils.py
parentHandle string read receipt data (#10606) (diff)
parentRemove the unused public_room_list_stream (#10565) (diff)
downloadsynapse-18572fddcc5bbcecabdcfbc69c8e8d4a1e9a1a1b.tar.xz
Merge branch 'release-v1.41' into matrix-org-hotfixes
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py

index a0c07f62f4..b6da2f60af 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py
@@ -17,7 +17,7 @@ from typing import Any, Mapping, Union from frozendict import frozendict -from synapse.api.constants import EventTypes, RelationTypes +from synapse.api.constants import EventContentFields, EventTypes, RelationTypes from synapse.api.errors import Codes, SynapseError from synapse.api.room_versions import RoomVersion from synapse.util.async_helpers import yieldable_gather_results @@ -135,6 +135,12 @@ def prune_event_dict(room_version: RoomVersion, event_dict: dict) -> dict: add_fields("history_visibility") elif event_type == EventTypes.Redaction and room_version.msc2176_redaction_rules: add_fields("redacts") + elif room_version.msc2716_redactions and event_type == EventTypes.MSC2716_INSERTION: + add_fields(EventContentFields.MSC2716_NEXT_CHUNK_ID) + elif room_version.msc2716_redactions and event_type == EventTypes.MSC2716_CHUNK: + add_fields(EventContentFields.MSC2716_CHUNK_ID) + elif room_version.msc2716_redactions and event_type == EventTypes.MSC2716_MARKER: + add_fields(EventContentFields.MSC2716_MARKER_INSERTION) allowed_fields = {k: v for k, v in event_dict.items() if k in allowed_keys}