mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Don't bundle events in /sync or /events
As we'll send down the annotations too anyway, so this just ends up confusing clients.
This commit is contained in:
parent
04d53794d6
commit
de7672b78f
@ -330,12 +330,13 @@ class EventClientSerializer(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def serialize_event(self, event, time_now, **kwargs):
|
def serialize_event(self, event, time_now, bundle_aggregations=True, **kwargs):
|
||||||
"""Serializes a single event.
|
"""Serializes a single event.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
event (EventBase)
|
event (EventBase)
|
||||||
time_now (int): The current time in milliseconds
|
time_now (int): The current time in milliseconds
|
||||||
|
bundle_aggregations (bool): Whether to bundle in related events
|
||||||
**kwargs: Arguments to pass to `serialize_event`
|
**kwargs: Arguments to pass to `serialize_event`
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -350,7 +351,7 @@ class EventClientSerializer(object):
|
|||||||
|
|
||||||
# If MSC1849 is enabled then we need to look if thre are any relations
|
# If MSC1849 is enabled then we need to look if thre are any relations
|
||||||
# we need to bundle in with the event
|
# we need to bundle in with the event
|
||||||
if self.experimental_msc1849_support_enabled:
|
if self.experimental_msc1849_support_enabled and bundle_aggregations:
|
||||||
annotations = yield self.store.get_aggregation_groups_for_event(
|
annotations = yield self.store.get_aggregation_groups_for_event(
|
||||||
event_id,
|
event_id,
|
||||||
)
|
)
|
||||||
|
@ -122,6 +122,9 @@ class EventStreamHandler(BaseHandler):
|
|||||||
|
|
||||||
chunks = yield self._event_serializer.serialize_events(
|
chunks = yield self._event_serializer.serialize_events(
|
||||||
events, time_now, as_client_event=as_client_event,
|
events, time_now, as_client_event=as_client_event,
|
||||||
|
# We don't bundle "live" events, as otherwise clients
|
||||||
|
# will end up double counting annotations.
|
||||||
|
bundle_aggregations=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
chunk = {
|
chunk = {
|
||||||
|
@ -358,6 +358,9 @@ class SyncRestServlet(RestServlet):
|
|||||||
def serialize(events):
|
def serialize(events):
|
||||||
return self._event_serializer.serialize_events(
|
return self._event_serializer.serialize_events(
|
||||||
events, time_now=time_now,
|
events, time_now=time_now,
|
||||||
|
# We don't bundle "live" events, as otherwise clients
|
||||||
|
# will end up double counting annotations.
|
||||||
|
bundle_aggregations=False,
|
||||||
token_id=token_id,
|
token_id=token_id,
|
||||||
event_format=event_formatter,
|
event_format=event_formatter,
|
||||||
only_event_fields=only_fields,
|
only_event_fields=only_fields,
|
||||||
|
Loading…
Reference in New Issue
Block a user