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): def parse_config(config):
return InviteCheckerConfig(config) return InviteCheckerConfig(config)
class InviteChecker: class InviteChecker:
def __init__(self, config, api: ModuleApi): def __init__(self, config, api: ModuleApi):
self.api = api self.api = api
@ -190,7 +189,7 @@ class InviteChecker:
@inlineCallbacks @inlineCallbacks
def user_may_invite(self, inviter: str, invitee: str, room_id: str): 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: if self.allow_all_invites_on_error:
logger.info(f"Allowing invite from {inviter} to {invitee} due to previous JSON fetch failure.") logger.info(f"Allowing invite from {inviter} to {invitee} due to previous JSON fetch failure.")
returnValue("NOT_SPAM") returnValue("NOT_SPAM")
@ -198,7 +197,7 @@ class InviteChecker:
blocklist, allowlist, blocklist_room_ids = yield self.get_blocklist_allowlist() blocklist, allowlist, blocklist_room_ids = yield self.get_blocklist_allowlist()
inviter_domain = UserID.from_string(inviter).domain 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") returnValue("NOT_SPAM")
if room_id in blocklist_room_ids: if room_id in blocklist_room_ids: