summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-21 13:54:09 +0100
committerErik Johnston <erik@matrix.org>2019-05-21 13:54:09 +0100
commitde7672b78f4dc250f7cfe151f4185bf186f3728c (patch)
tree0ad47dba5af858bfd5a71943d61cd8d098032c02 /synapse/events
parentFix error handling for rooms whose versions are unknown. (#5219) (diff)
downloadsynapse-de7672b78f4dc250f7cfe151f4185bf186f3728c.tar.xz
Don't bundle events in /sync or /events
As we'll send down the annotations too anyway, so this just ends up
confusing clients.
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index 27a2a9ef98..e2d4384de1 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -330,12 +330,13 @@ class EventClientSerializer(object):
         )
 
     @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.
 
         Args:
             event (EventBase)
             time_now (int): The current time in milliseconds
+            bundle_aggregations (bool): Whether to bundle in related events
             **kwargs: Arguments to pass to `serialize_event`
 
         Returns:
@@ -350,7 +351,7 @@ class EventClientSerializer(object):
 
         # If MSC1849 is enabled then we need to look if thre are any relations
         # 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(
                 event_id,
             )