mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 18:04:49 -04:00
Bundle relations of relations into the /relations
result. (#11284)
Per updates to MSC2675 which now states that bundled aggregations should be included from the `/relations` endpoint.
This commit is contained in:
parent
7ff22d6da4
commit
379f2650cf
4 changed files with 130 additions and 6 deletions
|
@ -435,6 +435,14 @@ class EventClientSerializer:
|
|||
serialized_event: The serialized event which may be modified.
|
||||
|
||||
"""
|
||||
# Do not bundle relations for an event which represents an edit or an
|
||||
# annotation. It does not make sense for them to have related events.
|
||||
relates_to = event.content.get("m.relates_to")
|
||||
if isinstance(relates_to, (dict, frozendict)):
|
||||
relation_type = relates_to.get("rel_type")
|
||||
if relation_type in (RelationTypes.ANNOTATION, RelationTypes.REPLACE):
|
||||
return
|
||||
|
||||
event_id = event.event_id
|
||||
|
||||
# The bundled relations to include.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue