summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-01-30 13:52:02 +0000
committerErik Johnston <erik@matrix.org>2015-01-30 13:52:02 +0000
commit76d7fd39cd44393a5c712930e77c64e202df17cc (patch)
tree8ffaffc369a3464074c56d0294b425a39064373c /synapse/state.py
parentfix pyflakes (diff)
downloadsynapse-76d7fd39cd44393a5c712930e77c64e202df17cc.tar.xz
Style changes.
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/state.py b/synapse/state.py
index d9fdfb34be..43bda35253 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -37,6 +37,9 @@ 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.
     """
@@ -215,7 +218,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:
@@ -240,10 +243,6 @@ class StateHandler(object):
             1. power levels
             2. memberships
             3. other events.
-
-        :param conflicted_state:
-        :param auth_events:
-        :return:
         """
         resolved_state = {}
         power_key = (EventTypes.PowerLevels, "")
@@ -305,4 +304,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)