summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-06 02:23:36 +0100
committerErik Johnston <erik@matrix.org>2014-09-06 02:23:36 +0100
commit781ff713ba65e9a8075063ee5112479afcb412ed (patch)
tree1df45adf38713cac9d045c43296f1026897c91c6 /synapse/storage/stream.py
parentDocument new invite key added to createRoom api (diff)
downloadsynapse-781ff713ba65e9a8075063ee5112479afcb412ed.tar.xz
When getting a state event also include the previous content
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 2cb0067a67..aff6dc9855 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -188,7 +188,7 @@ class StreamStore(SQLBaseStore):
             user_id, user_id, from_id, to_id
         )
 
-        ret = [self._parse_event_from_row(r) for r in rows]
+        ret = yield self._parse_events(rows)
 
         if rows:
             key = "s%d" % max([r["stream_ordering"] for r in rows])
@@ -243,9 +243,11 @@ class StreamStore(SQLBaseStore):
             # TODO (erikj): We should work out what to do here instead.
             next_token = to_key if to_key else from_key
 
+        events = yield self._parse_events(rows)
+
         defer.returnValue(
             (
-                [self._parse_event_from_row(r) for r in rows],
+                events,
                 next_token
             )
         )
@@ -277,12 +279,11 @@ class StreamStore(SQLBaseStore):
         else:
             token = (end_token, end_token)
 
-        defer.returnValue(
-            (
-                [self._parse_event_from_row(r) for r in rows],
-                token
-            )
-        )
+        events = yield self._parse_events(rows)
+
+        ret = (events, token)
+
+        defer.returnValue(ret)
 
     def get_room_events_max_id(self):
         return self._db_pool.runInteraction(self._get_room_events_max_id_txn)