From aa9b2fb1e4cf8c305798722a4744b8b2bb21cf3f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 29 Apr 2023 12:15:07 +0100 Subject: [PATCH] Blocking nicknames at account level --- blocking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocking.py b/blocking.py index 282327472..99075e6b9 100644 --- a/blocking.py +++ b/blocking.py @@ -646,7 +646,7 @@ def is_blocked_nickname(base_dir: str, nickname: str, def is_blocked(base_dir: str, nickname: str, domain: str, block_nickname: str, block_domain: str, blocked_cache: [] = None) -> bool: - """Is the given nickname blocked? + """Is the given account blocked? """ if is_evil(block_domain): return True @@ -694,6 +694,8 @@ def is_blocked(base_dir: str, nickname: str, domain: str, # account level block list blocking_filename = account_dir + '/blocking.txt' if os.path.isfile(blocking_filename): + if text_in_file(block_nickname + '@*' + '\n', blocking_filename): + return True if text_in_file('*@' + block_domain + '\n', blocking_filename): return True if block_handle: