summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-10-03 14:04:10 +0100
committerDavid Baker <dave@matrix.org>2017-10-03 14:04:10 +0100
commit2a7ed700d51f0a81f563298c78cd4566994ddbab (patch)
treee96b0ffa4aed1390cec67490a286d889ed654d9d
parentAllow spam checker to reject invites too (diff)
downloadsynapse-2a7ed700d51f0a81f563298c78cd4566994ddbab.tar.xz
Fix param name & lint
-rw-r--r--synapse/handlers/federation.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 32078fde3c..8571350cc8 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1078,8 +1078,10 @@ class FederationHandler(BaseHandler):
         if self.hs.config.block_non_admin_invites:
             raise SynapseError(403, "This server does not accept room invites")
 
-        if not self.spam_checker.user_may_invite(requester.user):
-            raise SynapseError(403, "This user is not permitted to send invites to this server")
+        if not self.spam_checker.user_may_invite(event.sender):
+            raise SynapseError(
+                403, "This user is not permitted to send invites to this server"
+            )
 
         membership = event.content.get("membership")
         if event.type != EventTypes.Member or membership != Membership.INVITE: