mirror of https://gitlab.com/bashrc2/epicyon
Handle tag dictionary
parent
add425a245
commit
4f39a0c7df
|
@ -11,10 +11,14 @@ import time
|
|||
import commentjson
|
||||
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
|
||||
"""
|
||||
for tagItem in tag:
|
||||
tagList=tag
|
||||
if isinstance(tag, dict):
|
||||
tagList=tag.items()
|
||||
|
||||
for tagItem in tagList:
|
||||
if not tagItem.get('type'):
|
||||
continue
|
||||
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, \
|
||||
mentionedRecipients, \
|
||||
hashtagsDict)
|
||||
content= \
|
||||
replaceEmojiFromTags(content,hashtagsDict,'content')
|
||||
content=replaceEmojiFromTagsDict(content,hashtagsDict,'content')
|
||||
|
||||
statusNumber,published = getStatusNumber()
|
||||
postTo='https://www.w3.org/ns/activitystreams#Public'
|
||||
|
|
Loading…
Reference in New Issue