diff --git a/synapse_invite_checker/invite_checker.py b/synapse_invite_checker/invite_checker.py index b098b56..07e3778 100644 --- a/synapse_invite_checker/invite_checker.py +++ b/synapse_invite_checker/invite_checker.py @@ -24,7 +24,6 @@ class InviteCheckerConfig: def parse_config(config): return InviteCheckerConfig(config) - class InviteChecker: def __init__(self, config, api: ModuleApi): self.api = api @@ -190,7 +189,7 @@ class InviteChecker: @inlineCallbacks def user_may_invite(self, inviter: str, invitee: str, room_id: str): - logger.info(f"Checking invite from {inviter} to {invitee} for room {room_id}") + logger.debug(f"Checking invite from {inviter} to {invitee} for room {room_id}") if self.allow_all_invites_on_error: logger.info(f"Allowing invite from {inviter} to {invitee} due to previous JSON fetch failure.") returnValue("NOT_SPAM") @@ -198,7 +197,7 @@ class InviteChecker: blocklist, allowlist, blocklist_room_ids = yield self.get_blocklist_allowlist() inviter_domain = UserID.from_string(inviter).domain - if self.use_allowlist and inviter_domain in allowlist: + if self.use_allowlist and (inviter_domain in allowlist or inviter in allowlist): returnValue("NOT_SPAM") if room_id in blocklist_room_ids: