mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-01 10:24:46 +00:00
Allow filtering without an account
This commit is contained in:
1 parent
cc2b9735fc
commit
97a5b774d4
1 file changed
+8
-5
+8
-5
@@ -91,6 +91,14 @@ def isFiltered(baseDir: str, nickname: str, domain: str, content: str) -> bool:
|
||||
You can add individual words or use word1+word2 to indicate that two
|
||||
words must be present although not necessarily adjacent
|
||||
"""
|
||||
globalFiltersFilename = baseDir + '/accounts/filters.txt'
|
||||
if os.path.isfile(globalFiltersFilename):
|
||||
if content + '\n' in open(globalFiltersFilename).read():
|
||||
return True
|
||||
|
||||
if not nickname or not domain:
|
||||
return False
|
||||
|
||||
# optionally remove retweets
|
||||
removeTwitter = baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/.removeTwitter'
|
||||
@@ -98,11 +106,6 @@ 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 + '\n' in open(globalFiltersFilename).read():
|
||||
return True
|
||||
|
||||
accountFiltersFilename = baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/filters.txt'
|
||||
if os.path.isfile(accountFiltersFilename):
|
||||
|
||||
Reference in new issue
Block a user