summary refs log tree commit diff
path: root/synapse/storage/presence.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-04-01 15:13:14 +0100
committerMark Haines <mjark@negativecurvature.net>2016-04-01 15:13:14 +0100
commitf2b916534bdbb5d126311a3fbe653fa9d1e4dcf0 (patch)
tree0c0edfab04b20cde74447189dd0917b454b2b030 /synapse/storage/presence.py
parentMerge pull request #685 from matrix-org/erikj/sync_leave (diff)
parentAssert that the step != 0 (diff)
downloadsynapse-f2b916534bdbb5d126311a3fbe653fa9d1e4dcf0.tar.xz
Merge pull request #684 from matrix-org/markjh/backfill_id_gen
Use a stream id generator for backfilled ids
Diffstat (limited to 'synapse/storage/presence.py')
-rw-r--r--synapse/storage/presence.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py
index 4cec31e316..59b4ef5ce6 100644
--- a/synapse/storage/presence.py
+++ b/synapse/storage/presence.py
@@ -68,7 +68,9 @@ class PresenceStore(SQLBaseStore):
                 self._update_presence_txn, stream_orderings, presence_states,
             )
 
-        defer.returnValue((stream_orderings[-1], self._presence_id_gen.get_max_token()))
+        defer.returnValue((
+            stream_orderings[-1], self._presence_id_gen.get_current_token()
+        ))
 
     def _update_presence_txn(self, txn, stream_orderings, presence_states):
         for stream_id, state in zip(stream_orderings, presence_states):
@@ -155,7 +157,7 @@ class PresenceStore(SQLBaseStore):
         defer.returnValue([UserPresenceState(**row) for row in rows])
 
     def get_current_presence_token(self):
-        return self._presence_id_gen.get_max_token()
+        return self._presence_id_gen.get_current_token()
 
     def allow_presence_visible(self, observed_localpart, observer_userid):
         return self._simple_insert(