summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-02-01 18:10:33 +0000
committerGitHub <noreply@github.com>2017-02-01 18:10:33 +0000
commit14d5e227003de2291986a915e121a3449e4f02fe (patch)
tree2db0e911aa3ab5cb2a2b5169e98552e1e37886b0 /synapse/storage/stream.py
parentMerge pull request #1871 from matrix-org/erikj/ratelimit_401 (diff)
parentDoc args (diff)
downloadsynapse-14d5e227003de2291986a915e121a3449e4f02fe.tar.xz
Merge pull request #1872 from matrix-org/erikj/key_changes
Include newly joined users in /keys/changes API
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 2dc24951c4..200d124632 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -244,6 +244,20 @@ class StreamStore(SQLBaseStore):
 
         defer.returnValue(results)
 
+    def get_rooms_that_changed(self, room_ids, from_key):
+        """Given a list of rooms and a token, return rooms where there may have
+        been changes.
+
+        Args:
+            room_ids (list)
+            from_key (str): The room_key portion of a StreamToken
+        """
+        from_key = RoomStreamToken.parse_stream_token(from_key).stream
+        return set(
+            room_id for room_id in room_ids
+            if self._events_stream_cache.has_entity_changed(room_id, from_key)
+        )
+
     @defer.inlineCallbacks
     def get_room_events_stream_for_room(self, room_id, from_key, to_key, limit=0,
                                         order='DESC'):