summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-28 11:34:17 +0000
committerErik Johnston <erik@matrix.org>2016-01-28 11:34:17 +0000
commitba8931829b0b601eb14049c92e0f21a10772576d (patch)
tree8adbbe84289bc298ff8b56f1f8c1e8a6ec8d600a /synapse/storage
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/sync (diff)
downloadsynapse-ba8931829b0b601eb14049c92e0f21a10772576d.tar.xz
Return correct type of token
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/stream.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 0b22251790..28721e6994 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -236,7 +236,7 @@ class StreamStore(SQLBaseStore):
 
             ret.reverse()
 
-            self._set_before_and_after(ret, rows)
+            self._set_before_and_after(ret, rows, topo_order=False)
 
             if rows:
                 key = "s%d" % min(r["stream_ordering"] for r in rows)
@@ -581,10 +581,13 @@ class StreamStore(SQLBaseStore):
         return rows[0][0] if rows else 0
 
     @staticmethod
-    def _set_before_and_after(events, rows):
+    def _set_before_and_after(events, rows, topo_order=True):
         for event, row in zip(events, rows):
             stream = row["stream_ordering"]
-            topo = event.depth
+            if topo_order:
+                topo = event.depth
+            else:
+                topo = None
             internal = event.internal_metadata
             internal.before = str(RoomStreamToken(topo, stream - 1))
             internal.after = str(RoomStreamToken(topo, stream))