summary refs log tree commit diff
path: root/synapse/handlers/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-26 19:40:29 +0100
committerErik Johnston <erik@matrix.org>2014-08-26 19:40:29 +0100
commit67c5f89244b9ff5f1deca199f35ef7240d0549cc (patch)
tree04abccb8896322ecf086bdd18d290f3dbfc537a7 /synapse/handlers/events.py
parentFix exceptions so that the event stream works. Presence like events are turne... (diff)
downloadsynapse-67c5f89244b9ff5f1deca199f35ef7240d0549cc.tar.xz
Enable presence again. Fix up api to match old api.
Diffstat (limited to 'synapse/handlers/events.py')
-rw-r--r--synapse/handlers/events.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py
index 2d7bd5083b..8c34776245 100644
--- a/synapse/handlers/events.py
+++ b/synapse/handlers/events.py
@@ -15,6 +15,8 @@
 
 from twisted.internet import defer
 
+from synapse.api.events import SynapseEvent
+
 from ._base import BaseHandler
 
 import logging
@@ -50,10 +52,15 @@ class EventStreamHandler(BaseHandler):
 
         events, tokens = yield self.notifier.get_events_for(auth_user, pagin_config, timeout)
 
+        chunks = [
+            e.get_dict() if isinstance(e, SynapseEvent) else e
+            for e in events
+        ]
+
         chunk = {
-            "chunk": [e.get_dict() for e in events],
-            "start_token": tokens[0].to_string(),
-            "end_token": tokens[1].to_string(),
+            "chunk": chunks,
+            "start": tokens[0].to_string(),
+            "end": tokens[1].to_string(),
         }
 
         defer.returnValue(chunk)