diff options
author | Erik Johnston <erik@matrix.org> | 2019-05-14 14:09:33 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-05-14 14:09:33 +0100 |
commit | ae69a6aa9dc3eefc6d945c20328bef7846a8aad2 (patch) | |
tree | bb0a33ed24a89657a8eac4fe819d84be47fed705 /synapse/rest/client/v1/events.py | |
parent | Newsfile (diff) | |
parent | Newsfile (diff) | |
download | synapse-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.py | 5 |
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.")) |