summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-05-09 13:21:57 +0100
committerErik Johnston <erik@matrix.org>2019-05-14 11:58:01 +0100
commitb54b03f9e1abc1964fe5f00115a165a2b8e10df5 (patch)
treebb2a357af902fbdfa935da416a6beaedbd5c8a02 /synapse/handlers/message.py
parentMigrate all tests to use the dict-based config format instead of hanging item... (diff)
downloadsynapse-b54b03f9e1abc1964fe5f00115a165a2b8e10df5.tar.xz
Allow client event serialization to be async
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):