summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-14 14:09:33 +0100
committerErik Johnston <erik@matrix.org>2019-05-14 14:09:33 +0100
commitae69a6aa9dc3eefc6d945c20328bef7846a8aad2 (patch)
treebb0a33ed24a89657a8eac4fe819d84be47fed705 /synapse/handlers/message.py
parentNewsfile (diff)
parentNewsfile (diff)
downloadsynapse-ae69a6aa9dc3eefc6d945c20328bef7846a8aad2.tar.xz
Merge branch 'erikj/async_serialize_event' into erikj/reactions_rebase
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index e5afeadf68..7b2c33a922 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -32,7 +32,6 @@ from synapse.api.errors import (
 )
 from synapse.api.room_versions import RoomVersions
 from synapse.api.urls import ConsentURIBuilder
-from synapse.events.utils import serialize_event
 from synapse.events.validator import EventValidator
 from synapse.replication.http.send_event import ReplicationSendEventRestServlet
 from synapse.storage.state import StateFilter
@@ -57,6 +56,7 @@ class MessageHandler(object):
         self.clock = hs.get_clock()
         self.state = hs.get_state_handler()
         self.store = hs.get_datastore()
+        self._event_serializer = hs.get_event_client_serializer()
 
     @defer.inlineCallbacks
     def get_room_data(self, user_id=None, room_id=None,
@@ -164,9 +164,10 @@ class MessageHandler(object):
                 room_state = room_state[membership_event_id]
 
         now = self.clock.time_msec()
-        defer.returnValue(
-            [serialize_event(c, now) for c in room_state.values()]
+        events = yield self._event_serializer.serialize_events(
+            room_state.values(), now,
         )
+        defer.returnValue(events)
 
     @defer.inlineCallbacks
     def get_joined_members(self, requester, room_id):