summary refs log tree commit diff
path: root/synapse/rest/client/v1/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-12 15:31:44 +0100
committerErik Johnston <erik@matrix.org>2016-08-12 15:31:44 +0100
commit4e1cebd56f9688d49a51929264c095356005f9a3 (patch)
tree4e4ba72e94950ce1e0329c333e2b1739b7fdd0b4 /synapse/rest/client/v1/events.py
parentDont invoke get_handlers fromClientV1RestServlet (diff)
downloadsynapse-4e1cebd56f9688d49a51929264c095356005f9a3.tar.xz
Make synchrotron accept /events
Diffstat (limited to 'synapse/rest/client/v1/events.py')
-rw-r--r--synapse/rest/client/v1/events.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/rest/client/v1/events.py b/synapse/rest/client/v1/events.py
index 998b115bb9..701b6f549b 100644
--- a/synapse/rest/client/v1/events.py
+++ b/synapse/rest/client/v1/events.py
@@ -34,7 +34,7 @@ class EventStreamRestServlet(ClientV1RestServlet):
 
     def __init__(self, hs):
         super(EventStreamRestServlet, self).__init__(hs)
-        self.handlers = hs.get_handlers()
+        self.event_stream_handler = hs.get_event_stream_handler()
 
     @defer.inlineCallbacks
     def on_GET(self, request):
@@ -50,7 +50,6 @@ class EventStreamRestServlet(ClientV1RestServlet):
         if "room_id" in request.args:
             room_id = request.args["room_id"][0]
 
-        handler = self.handlers.event_stream_handler
         pagin_config = PaginationConfig.from_request(request)
         timeout = EventStreamRestServlet.DEFAULT_LONGPOLL_TIME_MS
         if "timeout" in request.args:
@@ -61,7 +60,7 @@ class EventStreamRestServlet(ClientV1RestServlet):
 
         as_client_event = "raw" not in request.args
 
-        chunk = yield handler.get_stream(
+        chunk = yield self.event_stream_handler.get_stream(
             requester.user.to_string(),
             pagin_config,
             timeout=timeout,
@@ -84,12 +83,12 @@ class EventRestServlet(ClientV1RestServlet):
     def __init__(self, hs):
         super(EventRestServlet, self).__init__(hs)
         self.clock = hs.get_clock()
+        self.event_handler = hs.get_event_handler()
 
     @defer.inlineCallbacks
     def on_GET(self, request, event_id):
         requester = yield self.auth.get_user_by_req(request)
-        handler = self.handlers.event_handler
-        event = yield handler.get_event(requester.user, event_id)
+        event = yield self.event_handler.get_event(requester.user, event_id)
 
         time_now = self.clock.time_msec()
         if event: