diff --git a/content.py b/content.py index 56a92bfa..47500bd6 100644 --- a/content.py +++ b/content.py @@ -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': diff --git a/posts.py b/posts.py index 684faf5f..74c026fe 100644 --- a/posts.py +++ b/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'