forked from indymedia/epicyon
Handle tag dictionary
parent
add425a245
commit
4f39a0c7df
|
@ -11,10 +11,14 @@ import time
|
||||||
import commentjson
|
import commentjson
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
|
|
||||||
def replaceEmojiFromTags(content: str,tag: [],messageType: str) -> str:
|
def replaceEmojiFromTags(content: str,tag,messageType: str) -> str:
|
||||||
"""Uses the tags to replace :emoji: with html image markup
|
"""Uses the tags to replace :emoji: with html image markup
|
||||||
"""
|
"""
|
||||||
for tagItem in tag:
|
tagList=tag
|
||||||
|
if isinstance(tag, dict):
|
||||||
|
tagList=tag.items()
|
||||||
|
|
||||||
|
for tagItem in tagList:
|
||||||
if not tagItem.get('type'):
|
if not tagItem.get('type'):
|
||||||
continue
|
continue
|
||||||
if tagItem['type']!='Emoji':
|
if tagItem['type']!='Emoji':
|
||||||
|
|
3
posts.py
3
posts.py
|
@ -460,8 +460,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
|
||||||
nickname,domain,content, \
|
nickname,domain,content, \
|
||||||
mentionedRecipients, \
|
mentionedRecipients, \
|
||||||
hashtagsDict)
|
hashtagsDict)
|
||||||
content= \
|
content=replaceEmojiFromTagsDict(content,hashtagsDict,'content')
|
||||||
replaceEmojiFromTags(content,hashtagsDict,'content')
|
|
||||||
|
|
||||||
statusNumber,published = getStatusNumber()
|
statusNumber,published = getStatusNumber()
|
||||||
postTo='https://www.w3.org/ns/activitystreams#Public'
|
postTo='https://www.w3.org/ns/activitystreams#Public'
|
||||||
|
|
Loading…
Reference in New Issue