summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-04 10:36:28 +0000
committerErik Johnston <erik@matrix.org>2015-02-04 10:36:28 +0000
commitf275ba49bbcb86e111ed0d66dd99da617220ae79 (patch)
tree2aedafb7b4c6eea9d4b1c3c0e16a3e2a895428ab /synapse/state.py
parentRearrange persist_event so that do all the queries that need to be done befor... (diff)
downloadsynapse-f275ba49bbcb86e111ed0d66dd99da617220ae79.tar.xz
Fix state resolution to remember join_rules is a type of auth event.
Diffstat (limited to '')
-rw-r--r--synapse/state.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 8a056ee955..6a6fb8aea0 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -37,7 +37,10 @@ def _get_state_key_from_event(event):
 KeyStateTuple = namedtuple("KeyStateTuple", ("context", "type", "state_key"))
 
 
-AuthEventTypes = (EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,)
+AuthEventTypes = (
+    EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,
+    EventTypes.JoinRules,
+)
 
 
 class StateHandler(object):
@@ -259,6 +262,15 @@ class StateHandler(object):
         auth_events.update(resolved_state)
 
         for key, events in conflicted_state.items():
+            if key[0] == EventTypes.JoinRules:
+                resolved_state[key] = self._resolve_auth_events(
+                    events,
+                    auth_events
+                )
+
+        auth_events.update(resolved_state)
+
+        for key, events in conflicted_state.items():
             if key[0] == EventTypes.Member:
                 resolved_state[key] = self._resolve_auth_events(
                     events,