From eda542cd34b1453c02da1ffbc0b64ac87adc89cd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 19 Dec 2020 10:46:47 +0000 Subject: [PATCH] Global word filter --- filters.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filters.py b/filters.py index 744e2877..961ceddb 100644 --- a/filters.py +++ b/filters.py @@ -66,6 +66,11 @@ def isFiltered(baseDir: str, nickname: str, domain: str, content: str) -> bool: if isTwitterPost(content): return True + globalFiltersFilename = baseDir + '/accounts/filters.txt' + if os.path.isfile(globalFiltersFilename): + if content in open(globalFiltersFilename).read(): + return True + filtersFilename = baseDir + '/accounts/' + \ nickname + '@' + domain + '/filters.txt' if os.path.isfile(filtersFilename):