summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-06 17:26:13 +0000
committerErik Johnston <erik@matrix.org>2014-11-07 10:53:38 +0000
commit8421cabb9db89a9d4d2158f1a4828b15c4ce18e9 (patch)
tree11d7cf5264e5fcfc7c46f12cdd4be18150d64ecb
parentDon't query the DB for user power levels (diff)
downloadsynapse-8421cabb9db89a9d4d2158f1a4828b15c4ce18e9.tar.xz
Neaten things up a bit
-rw-r--r--synapse/api/auth.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 462e97bd90..bb25c4ec55 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -58,14 +58,13 @@ class Auth(object):
                     # TODO (erikj): Auth for outliers is done differently.
                     return True
 
-                is_state = hasattr(event, "state_key")
-
                 if event.type == RoomCreateEvent.TYPE:
                     # FIXME
                     return True
 
+                self._can_send_event(event)
+
                 if event.type == RoomMemberEvent.TYPE:
-                    self._can_send_event(event)
                     allowed = self.is_membership_change_allowed(event)
                     if allowed:
                         logger.debug("Allowing! %s", event)
@@ -73,8 +72,6 @@ class Auth(object):
                         logger.debug("Denying! %s", event)
                     return allowed
 
-                self._can_send_event(event)
-
                 if event.type == RoomPowerLevelsEvent.TYPE:
                     self._check_power_levels(event)