summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-29 16:59:24 +0000
committerErik Johnston <erik@matrix.org>2014-10-29 16:59:24 +0000
commite7858b6d7ef37849a3d2d5004743cdd21ec330a8 (patch)
treebe917c0b61075a287f169ec5210a0b2dab563603 /synapse/state.py
parentDon't reference PDU when persisting event (diff)
downloadsynapse-e7858b6d7ef37849a3d2d5004743cdd21ec330a8.tar.xz
Start filling out and using new events tables
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/state.py b/synapse/state.py
index cc6a7db96b..993c4f18d3 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -143,7 +143,9 @@ class StateHandler(object):
             defer.returnValue(False)
             return
 
-        new_state = yield self.resolve_state_groups(event.prev_events)
+        new_state = yield self.resolve_state_groups(
+            [e for e, _ in event.prev_events]
+        )
 
         event.old_state_events = copy.deepcopy(new_state)
 
@@ -157,12 +159,11 @@ class StateHandler(object):
 
     @defer.inlineCallbacks
     def get_current_state(self, room_id, event_type=None, state_key=""):
-        # FIXME: HACK!
-        pdus = yield self.store.get_latest_pdus_in_context(room_id)
+        events = yield self.store.get_latest_events_in_room(room_id)
 
         event_ids = [
-            encode_event_id(pdu_id, origin)
-            for pdu_id, origin, _ in pdus
+            e_id
+            for e_id, _ in events
         ]
 
         res = yield self.resolve_state_groups(event_ids)