summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-29 14:40:28 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-29 14:40:28 +0000
commite016f4043b81ffdedf71c4459772f66757386e44 (patch)
tree6f43ae89ec992ae5d480c7599f58784dc3da64ea /synapse/storage
parentRemove typing TODO (diff)
downloadsynapse-e016f4043b81ffdedf71c4459772f66757386e44.tar.xz
Use get_room_events_stream to get changes to the rooms if the number of changes is small
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/stream.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index db1816ea84..93ccfd8c10 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -181,6 +181,13 @@ class StreamStore(SQLBaseStore):
                 get_prev_content=True
             )
 
+            for event, row in zip(ret, rows):
+                stream = row["stream_ordering"]
+                topo = event.depth
+                internal = event.internal_metadata
+                internal.before = str(_StreamToken(topo, stream - 1))
+                internal.after = str(_StreamToken(topo, stream))
+
             if rows:
                 key = "s%d" % max([r["stream_ordering"] for r in rows])
             else: