Compare commits

...

2 commits

Author SHA1 Message Date
Patrick Cloke 3e604f9c66 Newsfragment 2021-11-09 12:59:36 -05:00
Patrick Cloke a5b10ce0cc Include aggregations of events in the /relations API. 2021-11-09 12:53:05 -05:00
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