diff --git a/content.py b/content.py index 036f660fd..e7b595028 100644 --- a/content.py +++ b/content.py @@ -111,7 +111,7 @@ def loadEmojiDict(emojiDataFilename: str,emojiDict: {}) -> None: emojiName=emojiName.split('..')[0] emojiDict[emojiName.lower()]=emojiUnicode -def addEmoji(baseDir: str,wordStr: str,httpPrefix: str,domain: str,replaceEmoji: {},postTags: {},emojiDict: {}) -> bool: +def addEmoji(baseDir: str,wordStr: str,httpPrefix: str,domain: str,replaceEmoji: {},postTags: {},emojiDict: {},inMessageContent: bool) -> bool: """Detects Emoji and adds them to the replacements dict Also updates the tags list to be added to the post """ @@ -144,7 +144,9 @@ def addEmoji(baseDir: str,wordStr: str,httpPrefix: str,domain: str,replaceEmoji: 'name': ':'+emoji+':', 'type': 'Emoji' } - replaceEmoji[wordStr]='' + if not inMessageContent: + # when altering emoji in display name + replaceEmoji[wordStr]='' return True def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},recipients: [],tags: {}) -> bool: diff --git a/webinterface.py b/webinterface.py index cffe76be3..2a027fa81 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1745,10 +1745,12 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ if displayName: if ':' in displayName: displayName=displayName.replace('
','').replace('
','') + emojiTags={} displayName= \ addHtmlTags(baseDir,httpPrefix, \ - nickname,domain,displayName,[],{}) + nickname,domain,displayName,[],emojiTags) displayName=displayName.replace('','').replace('
','') + displayName=htmlRemplaceEmojiFromTags(displayName,emojiTags) titleStr+=''+displayName+'' else: titleStr+='@'+actorNickname+'@'+actorDomain+'' @@ -1873,10 +1875,12 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ if displayName: if ':' in displayName: displayName=displayName.replace('','').replace('
','') + emojiTags={} displayName= \ addHtmlTags(baseDir,httpPrefix, \ - nickname,domain,displayName,[],{}) + nickname,domain,displayName,[],emojiTags) displayName=displayName.replace('','').replace('
','') + displayName=htmlRemplaceEmojiFromTags(displayName,emojiTags) titleStr=displayName+' '+titleStr avatarImageInPost= \