forked from indymedia/epicyon
Fix tags
parent
904cb793ce
commit
220f5683b9
|
@ -147,18 +147,17 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
domain=domain.split(':')[0]
|
domain=domain.split(':')[0]
|
||||||
followingFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/following.txt'
|
followingFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/following.txt'
|
||||||
if not os.path.isfile(followingFilename):
|
|
||||||
content=content.replace('\n','</p><p>')
|
|
||||||
content='<p>'+content+'</p>'
|
|
||||||
return content.replace('<p></p>','')
|
|
||||||
|
|
||||||
# read the following list so that we can detect just @nick
|
# read the following list so that we can detect just @nick
|
||||||
# in addition to @nick@domain
|
# in addition to @nick@domain
|
||||||
|
following=None
|
||||||
|
if os.path.isfile(followingFilename):
|
||||||
with open(followingFilename, "r") as f:
|
with open(followingFilename, "r") as f:
|
||||||
following = f.readlines()
|
following = f.readlines()
|
||||||
|
|
||||||
# extract mentions and tags from words
|
# extract mentions and tags from words
|
||||||
for wordStr in words:
|
for wordStr in words:
|
||||||
|
if following:
|
||||||
if addMention(wordStr,httpPrefix,following,replaceMentions,recipients):
|
if addMention(wordStr,httpPrefix,following,replaceMentions,recipients):
|
||||||
continue
|
continue
|
||||||
if addHashTags(wordStr,httpPrefix,originalDomain,replaceHashTags,hashtags):
|
if addHashTags(wordStr,httpPrefix,originalDomain,replaceHashTags,hashtags):
|
||||||
|
|
4
posts.py
4
posts.py
|
@ -433,13 +433,13 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
|
||||||
|
|
||||||
# create a list of hashtags
|
# create a list of hashtags
|
||||||
if hashtagsDict:
|
if hashtagsDict:
|
||||||
for tagName,tag in hashtagsDict.items():
|
|
||||||
tags.append(tag)
|
|
||||||
isPublic=False
|
isPublic=False
|
||||||
for recipient in toRecipients:
|
for recipient in toRecipients:
|
||||||
if recipient.endswith('#Public'):
|
if recipient.endswith('#Public'):
|
||||||
isPublic=True
|
isPublic=True
|
||||||
break
|
break
|
||||||
|
for tagName,tag in hashtagsDict.items():
|
||||||
|
tags.append(tag)
|
||||||
if isPublic:
|
if isPublic:
|
||||||
updateHashtagsIndex(baseDir,tag,newPostId)
|
updateHashtagsIndex(baseDir,tag,newPostId)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue