From f5c944c7f24ebdd6353b64bb8ee339f8a4942a1b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 21 Mar 2019 15:31:31 +0000 Subject: [PATCH] Fix comments --- synapse/events/spamcheck.py | 4 ++-- synapse/rulecheck/domain_rule_checker.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/synapse/events/spamcheck.py b/synapse/events/spamcheck.py index 107c2e1f35..92aaa05e79 100644 --- a/synapse/events/spamcheck.py +++ b/synapse/events/spamcheck.py @@ -57,8 +57,8 @@ class SpamChecker(object): invitee_userid (str|None): The user ID of the invitee. Is None if this is a third party invite and the 3PID is not bound to a user ID. - invitee_userid (dict|None): If a third party invite then is a dict - containing the medium and address of the invitee. + third_party_invite (dict|None): If a third party invite then is a + dict containing the medium and address of the invitee. room_id (str) new_room (bool): Wether the user is being invited to the room as part of a room creation, if so the invitee would have been diff --git a/synapse/rulecheck/domain_rule_checker.py b/synapse/rulecheck/domain_rule_checker.py index b379bbc5b4..bcec465ef4 100644 --- a/synapse/rulecheck/domain_rule_checker.py +++ b/synapse/rulecheck/domain_rule_checker.py @@ -84,7 +84,9 @@ class DomainRuleChecker(object): if not self.can_invite_by_third_party_id and third_party_invite: return False - if third_party_invite and not invitee_userid: + # This is a third party invite (without a bound mxid), so unless we have + # banned all third party invites (above) we allow it. + if not invitee_userid: return True inviter_domain = self._get_domain_from_id(inviter_userid)