Global word filter

alt-html-css
Bob Mottram 2020-12-19 10:46:47 +00:00
parent 0d9a12ac22
commit eda542cd34
1 changed files with 5 additions and 0 deletions

View File

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