summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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