change some logging settings

This commit is contained in:
Nils Büchner 2024-09-16 21:45:26 +02:00
parent cfbb669a18
commit 7ae1e5c83a

View file

@ -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: