mirror of https://gitlab.com/bashrc2/epicyon
Improve global filtering
parent
dfffd4e296
commit
c7051f191f
|
@ -93,8 +93,12 @@ def isFiltered(baseDir: str, nickname: str, domain: str, content: str) -> bool:
|
||||||
"""
|
"""
|
||||||
globalFiltersFilename = baseDir + '/accounts/filters.txt'
|
globalFiltersFilename = baseDir + '/accounts/filters.txt'
|
||||||
if os.path.isfile(globalFiltersFilename):
|
if os.path.isfile(globalFiltersFilename):
|
||||||
if content + '\n' in open(globalFiltersFilename).read():
|
wordsFile = open(globalFiltersFilename, 'r')
|
||||||
return True
|
if wordsFile:
|
||||||
|
wordsList = wordsFile.read().split('\n')
|
||||||
|
for word in wordsList:
|
||||||
|
if word in content:
|
||||||
|
return True
|
||||||
|
|
||||||
if not nickname or not domain:
|
if not nickname or not domain:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue