mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 00:14:55 -04:00
Do not bundle aggregations for APIs which shouldn't include them. (#11592)
And make bundling aggregations opt-in, instead of opt-out to avoid having APIs to include extraneous data (and being much heavier than necessary).
This commit is contained in:
parent
c3e38b88f2
commit
dd47788752
9 changed files with 31 additions and 27 deletions
|
@ -662,7 +662,9 @@ class RoomEventServlet(RestServlet):
|
|||
|
||||
time_now = self.clock.time_msec()
|
||||
if event:
|
||||
event_dict = await self._event_serializer.serialize_event(event, time_now)
|
||||
event_dict = await self._event_serializer.serialize_event(
|
||||
event, time_now, bundle_aggregations=True
|
||||
)
|
||||
return 200, event_dict
|
||||
|
||||
raise SynapseError(404, "Event not found.", errcode=Codes.NOT_FOUND)
|
||||
|
@ -707,13 +709,13 @@ class RoomEventContextServlet(RestServlet):
|
|||
|
||||
time_now = self.clock.time_msec()
|
||||
results["events_before"] = await self._event_serializer.serialize_events(
|
||||
results["events_before"], time_now
|
||||
results["events_before"], time_now, bundle_aggregations=True
|
||||
)
|
||||
results["event"] = await self._event_serializer.serialize_event(
|
||||
results["event"], time_now
|
||||
results["event"], time_now, bundle_aggregations=True
|
||||
)
|
||||
results["events_after"] = await self._event_serializer.serialize_events(
|
||||
results["events_after"], time_now
|
||||
results["events_after"], time_now, bundle_aggregations=True
|
||||
)
|
||||
results["state"] = await self._event_serializer.serialize_events(
|
||||
results["state"], time_now
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue