summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-17 15:04:17 +0100
committerErik Johnston <erik@matrix.org>2014-10-17 15:04:17 +0100
commitf71627567b4aa58c5aba7e79c6d972b8ac26b449 (patch)
tree08f077bc1cbcc2d84e5783d41b2bbe84fbc3b24c /synapse/state.py
parentStart implementing the invite/join dance. Continue moving auth to use event.s... (diff)
downloadsynapse-f71627567b4aa58c5aba7e79c6d972b8ac26b449.tar.xz
Finish implementing the new join dance.
Diffstat (limited to '')
-rw-r--r--synapse/state.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 9be6b716e2..8c4eeb8924 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -130,7 +130,13 @@ class StateHandler(object):
         defer.returnValue(is_new)
 
     @defer.inlineCallbacks
-    def annotate_state_groups(self, event):
+    def annotate_state_groups(self, event, state=None):
+        if state:
+            event.state_group = None
+            event.old_state_events = None
+            event.state_events = state
+            return
+
         state_groups = yield self.store.get_state_groups(
             event.prev_events
         )
@@ -177,7 +183,7 @@ class StateHandler(object):
         new_powers_deferreds = []
         for e in curr_events:
             new_powers_deferreds.append(
-                self.store.get_power_level(e.context, e.user_id)
+                self.store.get_power_level(e.room_id, e.user_id)
             )
 
         new_powers = yield defer.gatherResults(