summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-01-30 14:19:49 +0000
committerErik Johnston <erik@matrix.org>2015-01-30 14:19:49 +0000
commitc515d377973560a6e9d96fa5ee53e1de7dc67347 (patch)
treeec58161881f5d9180a41bb8610152cfe5ff0ddc5 /synapse/state.py
parentFix bug where we superfluously asked for current state. Change API of /query_... (diff)
parentMerge branch 'rejections_storage' of github.com:matrix-org/synapse into repli... (diff)
downloadsynapse-c515d377973560a6e9d96fa5ee53e1de7dc67347.tar.xz
Merge branch 'replication_split' of github.com:matrix-org/synapse into rejections
Conflicts:
	synapse/storage/schema/delta/v12.sql
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/state.py b/synapse/state.py
index e6632978b5..bb439ed9d0 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -37,13 +37,15 @@ def _get_state_key_from_event(event):
 KeyStateTuple = namedtuple("KeyStateTuple", ("context", "type", "state_key"))
 
 
+AuthEventTypes = (EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,)
+
+
 class StateHandler(object):
     """ Responsible for doing state conflict resolution.
     """
 
     def __init__(self, hs):
         self.store = hs.get_datastore()
-        # self.auth = hs.get_auth()
         self.hs = hs
 
     @defer.inlineCallbacks
@@ -231,7 +233,7 @@ class StateHandler(object):
 
         auth_events = {
             k: e for k, e in unconflicted_state.items()
-            if k[0] in (EventTypes.Create, EventTypes.Member, EventTypes.PowerLevels,)
+            if k[0] in AuthEventTypes
         }
 
         try:
@@ -317,4 +319,4 @@ class StateHandler(object):
         def key_func(e):
             return -int(e.depth), hashlib.sha1(e.event_id).hexdigest()
 
-        return sorted(events, key=key_func)
\ No newline at end of file
+        return sorted(events, key=key_func)