summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-25 18:15:51 +0100
committerErik Johnston <erik@matrix.org>2016-08-25 18:15:51 +0100
commit0e1900d8193a612d6920a9eca0aec4813e17d355 (patch)
tree0fb6bb7026bb02525df63f6e06563ea54cfdef5e /synapse/state.py
parentAdd desc (diff)
downloadsynapse-0e1900d8193a612d6920a9eca0aec4813e17d355.tar.xz
Pull out full state less
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 2a01887a67..78461215ca 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -95,15 +95,19 @@ class StateHandler(object):
 
         _, state = yield self.resolve_state_groups(room_id, latest_event_ids)
 
+        if event_type:
+            event_id = state.get((event_type, state_key))
+            event = None
+            if event_id:
+                event = yield self.store.get_event(event_id, allow_none=True)
+            defer.returnValue(event)
+            return
+
         state_map = yield self.store.get_events(state.values(), get_prev_content=False)
         state = {
             key: state_map[e_id] for key, e_id in state.items() if e_id in state_map
         }
 
-        if event_type:
-            defer.returnValue(state.get((event_type, state_key)))
-            return
-
         defer.returnValue(state)
 
     @defer.inlineCallbacks