summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-31 14:27:14 +0000
committerErik Johnston <erik@matrix.org>2014-10-31 14:27:14 +0000
commit2f39dc19a26cca25305d10654916d7413a56a23a (patch)
tree46833964134f5e9d8bf022581a933735a15a4d80 /synapse/state.py
parentRemove PDU tables. (diff)
downloadsynapse-2f39dc19a26cca25305d10654916d7413a56a23a.tar.xz
Remove more references to dead PDU tables
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/synapse/state.py b/synapse/state.py
index f7249705ce..2548deed28 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -77,29 +77,18 @@ class StateHandler(object):
         snapshot.fill_out_prev_events(event)
         yield self.annotate_state_groups(event)
 
-        current_state = snapshot.prev_state_pdu
+        if event.old_state_events:
+            current_state = event.old_state_events.get(
+                (event.type, event.state_key)
+            )
 
-        if current_state:
-            event.prev_state = EventID.create(
-                current_state.pdu_id, current_state.origin, self.hs
-            ).to_string()
+            if current_state:
+                event.prev_state = current_state.event_id
 
         # TODO check current_state to see if the min power level is less
         # than the power level of the user
         # power_level = self._get_power_level_for_event(event)
 
-        e_id = self.hs.parse_eventid(event.event_id)
-        pdu_id = e_id.localpart
-        origin = e_id.domain
-
-        yield self.store.update_current_state(
-            pdu_id=pdu_id,
-            origin=origin,
-            context=key.context,
-            pdu_type=key.type,
-            state_key=key.state_key
-        )
-
         defer.returnValue(True)
 
     @defer.inlineCallbacks