mirror of https://gitlab.com/bashrc2/epicyon
Replace emoji tags
parent
a8689b749c
commit
218693f7b1
|
@ -111,7 +111,7 @@ def loadEmojiDict(emojiDataFilename: str,emojiDict: {}) -> None:
|
||||||
emojiName=emojiName.split('..')[0]
|
emojiName=emojiName.split('..')[0]
|
||||||
emojiDict[emojiName.lower()]=emojiUnicode
|
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
|
"""Detects Emoji and adds them to the replacements dict
|
||||||
Also updates the tags list to be added to the post
|
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+':',
|
'name': ':'+emoji+':',
|
||||||
'type': 'Emoji'
|
'type': 'Emoji'
|
||||||
}
|
}
|
||||||
replaceEmoji[wordStr]='<img src="'+emojiUrl+'" title="'+emoji+'" alt="'+emoji+'"/>'
|
if not inMessageContent:
|
||||||
|
# when altering emoji in display name
|
||||||
|
replaceEmoji[wordStr]='<img src="'+emojiUrl+'" title="'+emoji+'" alt="'+emoji+'"/>'
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},recipients: [],tags: {}) -> bool:
|
def addMention(wordStr: str,httpPrefix: str,following: str,replaceMentions: {},recipients: [],tags: {}) -> bool:
|
||||||
|
|
|
@ -1745,10 +1745,12 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
if displayName:
|
if displayName:
|
||||||
if ':' in displayName:
|
if ':' in displayName:
|
||||||
displayName=displayName.replace('<p>','').replace('</p>','')
|
displayName=displayName.replace('<p>','').replace('</p>','')
|
||||||
|
emojiTags={}
|
||||||
displayName= \
|
displayName= \
|
||||||
addHtmlTags(baseDir,httpPrefix, \
|
addHtmlTags(baseDir,httpPrefix, \
|
||||||
nickname,domain,displayName,[],{})
|
nickname,domain,displayName,[],emojiTags)
|
||||||
displayName=displayName.replace('<p>','').replace('</p>','')
|
displayName=displayName.replace('<p>','').replace('</p>','')
|
||||||
|
displayName=htmlRemplaceEmojiFromTags(displayName,emojiTags)
|
||||||
titleStr+='<a href="'+messageId+'">'+displayName+'</a>'
|
titleStr+='<a href="'+messageId+'">'+displayName+'</a>'
|
||||||
else:
|
else:
|
||||||
titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>'
|
titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>'
|
||||||
|
@ -1873,10 +1875,12 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
if displayName:
|
if displayName:
|
||||||
if ':' in displayName:
|
if ':' in displayName:
|
||||||
displayName=displayName.replace('<p>','').replace('</p>','')
|
displayName=displayName.replace('<p>','').replace('</p>','')
|
||||||
|
emojiTags={}
|
||||||
displayName= \
|
displayName= \
|
||||||
addHtmlTags(baseDir,httpPrefix, \
|
addHtmlTags(baseDir,httpPrefix, \
|
||||||
nickname,domain,displayName,[],{})
|
nickname,domain,displayName,[],emojiTags)
|
||||||
displayName=displayName.replace('<p>','').replace('</p>','')
|
displayName=displayName.replace('<p>','').replace('</p>','')
|
||||||
|
displayName=htmlRemplaceEmojiFromTags(displayName,emojiTags)
|
||||||
titleStr=displayName+' '+titleStr
|
titleStr=displayName+' '+titleStr
|
||||||
|
|
||||||
avatarImageInPost= \
|
avatarImageInPost= \
|
||||||
|
|
Loading…
Reference in New Issue