mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 16:44:55 -04:00
Include bundled aggregations in /sync and related fixes (#11478)
Due to updates to MSC2675 this includes a few fixes: * Include bundled aggregations for /sync. * Do not include bundled aggregations for /initialSync and /events. * Do not bundle aggregations for state events. * Clarifies comments and variable names.
This commit is contained in:
parent
a77c369897
commit
494ebd7347
10 changed files with 169 additions and 101 deletions
|
@ -449,13 +449,7 @@ class RoomStateRestServlet(RestServlet):
|
|||
event_ids = await self.store.get_current_state_ids(room_id)
|
||||
events = await self.store.get_events(event_ids.values())
|
||||
now = self.clock.time_msec()
|
||||
room_state = await self._event_serializer.serialize_events(
|
||||
events.values(),
|
||||
now,
|
||||
# We don't bother bundling aggregations in when asked for state
|
||||
# events, as clients won't use them.
|
||||
bundle_relations=False,
|
||||
)
|
||||
room_state = await self._event_serializer.serialize_events(events.values(), now)
|
||||
ret = {"state": room_state}
|
||||
|
||||
return HTTPStatus.OK, ret
|
||||
|
@ -789,10 +783,7 @@ class RoomEventContextServlet(RestServlet):
|
|||
results["events_after"], time_now
|
||||
)
|
||||
results["state"] = await self._event_serializer.serialize_events(
|
||||
results["state"],
|
||||
time_now,
|
||||
# No need to bundle aggregations for state events
|
||||
bundle_relations=False,
|
||||
results["state"], time_now
|
||||
)
|
||||
|
||||
return HTTPStatus.OK, results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue