forked from indymedia/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'
|
||||
if os.path.isfile(globalBlockingFilename):
|
||||
hashtag = hashtag.strip('\n').strip('\r')
|
||||
if not hashtag.startswith('#'):
|
||||
hashtag = '#' + hashtag
|
||||
if hashtag + '\n' in open(globalBlockingFilename).read():
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -123,7 +123,7 @@ def addNewswireDictEntry(baseDir: str, domain: str,
|
|||
|
||||
# check that no tags are blocked
|
||||
for tag in postTags:
|
||||
if isBlockedHashtag(baseDir, tag.replace('#', '')):
|
||||
if isBlockedHashtag(baseDir, tag):
|
||||
return
|
||||
|
||||
newswire[dateStr] = [
|
||||
|
|
Loading…
Reference in New Issue