forked from indymedia/epicyon
Handle mentions even if not following
parent
fc0d1ab8a5
commit
984712ab45
|
@ -107,7 +107,7 @@ def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},r
|
|||
possibleHandle=wordStr[1:]
|
||||
print('Possible mention: '+possibleHandle)
|
||||
# @nick
|
||||
if '@' not in possibleHandle:
|
||||
if following and '@' not in possibleHandle:
|
||||
# fall back to a best effort match against the following list
|
||||
# if no domain was specified. eg. @nick
|
||||
possibleNickname=possibleHandle
|
||||
|
@ -122,6 +122,7 @@ def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},r
|
|||
return False
|
||||
possibleNickname=possibleHandle.split('@')[0]
|
||||
possibleDomain=possibleHandle.split('@')[1].strip('\n')
|
||||
if following:
|
||||
for follow in following:
|
||||
if follow.replace('\n','')!=possibleHandle:
|
||||
continue
|
||||
|
@ -183,7 +184,6 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
|
|||
|
||||
# extract mentions and tags from words
|
||||
for wordStr in words:
|
||||
if following:
|
||||
if addMention(wordStr,httpPrefix,following,replaceMentions,recipients):
|
||||
continue
|
||||
if addHashTags(wordStr,httpPrefix,originalDomain,replaceHashTags,hashtags):
|
||||
|
|
Loading…
Reference in New Issue