summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2018-01-31 22:17:57 +0100
committerGitHub <noreply@github.com>2018-01-31 22:17:57 +0100
commitad48dfe73d04cea3087b841bee6693b0bb39793a (patch)
treed229c88ba46cc408669e6354f800676e58fb3394 /synapse/state.py
parentMerge pull request #2834 from matrix-org/rav/better_persist_event_exception_h... (diff)
parentdocstring for get_current_state_ids (diff)
downloadsynapse-ad48dfe73d04cea3087b841bee6693b0bb39793a.tar.xz
Merge pull request #2835 from matrix-org/rav/remove_event_type_param
Remove unused "event_type" param on state.get_current_state_ids
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 1f9abf9d3d..4c8247e7c2 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -146,8 +146,20 @@ class StateHandler(object):
         defer.returnValue(state)
 
     @defer.inlineCallbacks
-    def get_current_state_ids(self, room_id, event_type=None, state_key="",
-                              latest_event_ids=None):
+    def get_current_state_ids(self, room_id, latest_event_ids=None):
+        """Get the current state, or the state at a set of events, for a room
+
+        Args:
+            room_id (str):
+
+            latest_event_ids (iterable[str]|None): if given, the forward
+                extremities to resolve. If None, we look them up from the
+                database (via a cache)
+
+        Returns:
+            Deferred[dict[(str, str), str)]]: the state dict, mapping from
+                (event_type, state_key) -> event_id
+        """
         if not latest_event_ids:
             latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)
 
@@ -155,10 +167,6 @@ class StateHandler(object):
         ret = yield self.resolve_state_groups(room_id, latest_event_ids)
         state = ret.state
 
-        if event_type:
-            defer.returnValue(state.get((event_type, state_key)))
-            return
-
         defer.returnValue(state)
 
     @defer.inlineCallbacks