mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
Refactor the code to inject bundled relations during serialization. (#11408)
This commit is contained in:
parent
1035663833
commit
6a5dd485bd
8 changed files with 92 additions and 73 deletions
|
@ -224,17 +224,17 @@ class RelationPaginationServlet(RestServlet):
|
|||
)
|
||||
|
||||
now = self.clock.time_msec()
|
||||
# We set bundle_aggregations to False when retrieving the original
|
||||
# We set bundle_relations to False when retrieving the original
|
||||
# event because we want the content before relations were applied to
|
||||
# it.
|
||||
original_event = await self._event_serializer.serialize_event(
|
||||
event, now, bundle_aggregations=False
|
||||
event, now, bundle_relations=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
|
||||
events, now, bundle_relations=False
|
||||
)
|
||||
|
||||
return_value = pagination_chunk.to_dict()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue