Function for reply without display name

main
Bob Mottram 2020-12-01 13:52:41 +00:00
parent 7ca718d8af
commit 63575327cf
1 changed files with 18 additions and 13 deletions

View File

@ -846,6 +846,21 @@ def getReplyHtml(translate: {}, iconsPath: str,
replyDisplayName + '</a>\n' replyDisplayName + '</a>\n'
def getReplyWithoutDisplayName(translate: {}, iconsPath: str,
inReplyTo: str,
replyNickname: str, replyDomain: str) -> str:
"""Returns html for a reply without a display name,
only a handle nick@domain
"""
return ' ' + \
'<img loading="lazy" title="' + translate['replying to'] + \
'" alt="' + translate['replying to'] + \
'" src="/' + iconsPath + '/reply.png" ' + \
'class="announceOrReply"/>\n' + ' <a href="' + \
inReplyTo + '" class="announceOrReply">@' + \
replyNickname + '@' + replyDomain + '</a>\n'
def logPostTiming(enableTimingLog: bool, postStartTime, debugId: str) -> None: def logPostTiming(enableTimingLog: bool, postStartTime, debugId: str) -> None:
"""Create a log of timings for performance tuning """Create a log of timings for performance tuning
""" """
@ -962,19 +977,9 @@ def getPostTitleReplyHtml(baseDir: str,
inReplyTo = \ inReplyTo = \
postJsonObject['object']['inReplyTo'] postJsonObject['object']['inReplyTo']
titleStr += \ titleStr += \
' ' + \ getReplyWithoutDisplayName(translate, iconsPath,
'<img loading="lazy" title="' + \ inReplyTo,
translate['replying to'] + \ replyNickname, replyDomain)
'" alt="' + \
translate['replying to'] + \
'" src="/' + \
iconsPath + '/reply.png" ' + \
'class="announceOrReply"/>\n' + \
' <a href="' + \
inReplyTo + '" ' + \
'class="announceOrReply">@' + \
replyNickname + '@' + \
replyDomain + '</a>\n'
else: else:
titleStr += \ titleStr += \
replyToUnknownHtml(translate, iconsPath, postJsonObject) replyToUnknownHtml(translate, iconsPath, postJsonObject)