This commit is contained in:
Patrick Cloke 2021-11-10 21:26:00 +01:00 committed by GitHub
commit 6ef0743cf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -0,0 +1 @@
Include bundled relations in response to the `/relations` API, per [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440).

View file

@ -230,12 +230,9 @@ class RelationPaginationServlet(RestServlet):
original_event = await self._event_serializer.serialize_event(
event, now, bundle_aggregations=False
)
# Similarly, we don't allow relations to be applied to relations, so we
# return the original relations without any aggregations on top of them
# here.
serialized_events = await self._event_serializer.serialize_events(
events, now, bundle_aggregations=False
)
# For any relations applying to the original event they need their
# aggregations applied to them.
serialized_events = await self._event_serializer.serialize_events(events, now)
return_value = pagination_chunk.to_dict()
return_value["chunk"] = serialized_events