Add emoji to CW

merge-requests/8/head
Bob Mottram 2020-12-29 09:52:52 +00:00
parent 2083a2d59a
commit 14fbed456a
2 changed files with 7 additions and 3 deletions

View File

@ -1498,8 +1498,12 @@ def individualPostAsHtml(allowDownloads: bool,
postID = 'post' + str(createPassword(8)) postID = 'post' + str(createPassword(8))
contentStr = '' contentStr = ''
if postJsonObject['object'].get('summary'): if postJsonObject['object'].get('summary'):
contentStr += \ cwStr = str(postJsonObject['object']['summary'])
'<b>' + str(postJsonObject['object']['summary']) + '</b>\n ' cwStr = \
addEmojiToDisplayName(baseDir, httpPrefix,
nickname, domain,
cwStr, False)
contentStr += '<b>' + cwStr + '</b>\n '
if isModerationPost: if isModerationPost:
containerClass = 'container report' containerClass = 'container report'
# get the content warning text # get the content warning text

View File

@ -576,7 +576,7 @@ def loadIndividualPostAsHtmlFromCache(baseDir: str,
def addEmojiToDisplayName(baseDir: str, httpPrefix: str, def addEmojiToDisplayName(baseDir: str, httpPrefix: str,
nickname: str, domain: str, nickname: str, domain: str,
displayName: str, inProfileName: bool) -> str: displayName: str, inProfileName: bool) -> str:
"""Adds emoji icons to display names on individual posts """Adds emoji icons to display names or CW on individual posts
""" """
if ':' not in displayName: if ':' not in displayName:
return displayName return displayName