summary refs log tree commit diff
path: root/synapse/rest/client/v1/events.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/rest/client/v1/events.py
parentNewsfile (diff)
parentNewsfile (diff)
downloadsynapse-ae69a6aa9dc3eefc6d945c20328bef7846a8aad2.tar.xz
Merge branch 'erikj/async_serialize_event' into erikj/reactions_rebase
Diffstat (limited to 'synapse/rest/client/v1/events.py')
-rw-r--r--synapse/rest/client/v1/events.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/events.py b/synapse/rest/client/v1/events.py
index cd9b3bdbd1..c3b0a39ab7 100644
--- a/synapse/rest/client/v1/events.py
+++ b/synapse/rest/client/v1/events.py
@@ -19,7 +19,6 @@ import logging
 from twisted.internet import defer
 
 from synapse.api.errors import SynapseError
-from synapse.events.utils import serialize_event
 from synapse.streams.config import PaginationConfig
 
 from .base import ClientV1RestServlet, client_path_patterns
@@ -84,6 +83,7 @@ class EventRestServlet(ClientV1RestServlet):
         super(EventRestServlet, self).__init__(hs)
         self.clock = hs.get_clock()
         self.event_handler = hs.get_event_handler()
+        self._event_serializer = hs.get_event_client_serializer()
 
     @defer.inlineCallbacks
     def on_GET(self, request, event_id):
@@ -92,7 +92,8 @@ class EventRestServlet(ClientV1RestServlet):
 
         time_now = self.clock.time_msec()
         if event:
-            defer.returnValue((200, serialize_event(event, time_now)))
+            event = yield self._event_serializer.serialize_event(event, time_now)
+            defer.returnValue((200, event))
         else:
             defer.returnValue((404, "Event not found."))