Function for reply to unknown handle

main
Bob Mottram 2020-12-01 13:17:51 +00:00
parent 1942679172
commit c6e9d38f53
1 changed files with 15 additions and 10 deletions

View File

@ -850,6 +850,20 @@ def replyToYourselfHtml(translate: {}, iconsPath: str) -> str:
'/reply.png" class="announceOrReply"/>\n' '/reply.png" class="announceOrReply"/>\n'
def replyToUnknownHtml(translate: {}, iconsPath: str,
postJsonObject: {}) -> str:
"""Returns the html title for a reply to an unknown handle
"""
return ' <img loading="lazy" title="' + \
translate['replying to'] + '" alt="' + \
translate['replying to'] + '" src="/' + \
iconsPath + \
'/reply.png" class="announceOrReply"/>\n' + \
' <a href="' + \
postJsonObject['object']['inReplyTo'] + \
'" class="announceOrReply">@unknown</a>\n'
def getPostTitleReplyHtml(baseDir: str, def getPostTitleReplyHtml(baseDir: str,
httpPrefix: str, httpPrefix: str,
nickname: str, domain: str, nickname: str, domain: str,
@ -1007,16 +1021,7 @@ def getPostTitleReplyHtml(baseDir: str,
replyDomain + '</a>\n' replyDomain + '</a>\n'
else: else:
titleStr += \ titleStr += \
' <img loading="lazy" title="' + \ replyToUnknownHtml(translate, iconsPath, postJsonObject)
translate['replying to'] + \
'" alt="' + \
translate['replying to'] + \
'" src="/' + \
iconsPath + \
'/reply.png" class="announceOrReply"/>\n' + \
' <a href="' + \
postJsonObject['object']['inReplyTo'] + \
'" class="announceOrReply">@unknown</a>\n'
else: else:
postDomain = \ postDomain = \
postJsonObject['object']['inReplyTo'] postJsonObject['object']['inReplyTo']