mirror of https://gitlab.com/bashrc2/epicyon
Check for blocked hashtag with hash prefix
parent
c0eedb0716
commit
60abb1a0a6
|
@ -131,6 +131,8 @@ def isBlockedHashtag(baseDir: str, hashtag: str) -> bool:
|
||||||
globalBlockingFilename = baseDir + '/accounts/blocking.txt'
|
globalBlockingFilename = baseDir + '/accounts/blocking.txt'
|
||||||
if os.path.isfile(globalBlockingFilename):
|
if os.path.isfile(globalBlockingFilename):
|
||||||
hashtag = hashtag.strip('\n').strip('\r')
|
hashtag = hashtag.strip('\n').strip('\r')
|
||||||
|
if not hashtag.startswith('#'):
|
||||||
|
hashtag = '#' + hashtag
|
||||||
if hashtag + '\n' in open(globalBlockingFilename).read():
|
if hashtag + '\n' in open(globalBlockingFilename).read():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -123,7 +123,7 @@ def addNewswireDictEntry(baseDir: str, domain: str,
|
||||||
|
|
||||||
# check that no tags are blocked
|
# check that no tags are blocked
|
||||||
for tag in postTags:
|
for tag in postTags:
|
||||||
if isBlockedHashtag(baseDir, tag.replace('#', '')):
|
if isBlockedHashtag(baseDir, tag):
|
||||||
return
|
return
|
||||||
|
|
||||||
newswire[dateStr] = [
|
newswire[dateStr] = [
|
||||||
|
|
Loading…
Reference in New Issue