Don't show long hashtags

merge-requests/8/head
Bob Mottram 2020-08-07 21:40:53 +01:00
parent fac9296caf
commit cc90910908
1 changed files with 3 additions and 0 deletions

View File

@ -118,6 +118,9 @@ def removeBlock(baseDir: str, nickname: str, domain: str,
def isBlockedHashtag(baseDir: str, hashtag: str) -> bool: def isBlockedHashtag(baseDir: str, hashtag: str) -> bool:
"""Is the given hashtag blocked? """Is the given hashtag blocked?
""" """
# avoid very long hashtags
if len(hashtag) > 32:
return True
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')