Broken link substitute for reply image in post

main
Bob Mottram 2020-12-06 15:35:49 +00:00
parent 5c6a45956c
commit 2887fb2661
1 changed files with 12 additions and 3 deletions

View File

@ -772,6 +772,10 @@ def getPostTitleAnnounceHtml(baseDir: str,
if announceAvatarUrl:
idx = 'Show options for this person'
if '/users/news/' not in announceAvatarUrl:
brokenLinkSubstitute = \
" onerror=\"this.onerror=null; this.src='" + \
iconsPath + "/avatar_default.png'\""
replyAvatarImageInPost = \
' ' \
'<div class=' + \
@ -785,9 +789,10 @@ def getPostTitleAnnounceHtml(baseDir: str,
';' + announceAvatarUrl + \
messageIdStr + '">' \
'<img loading="lazy" src="' + \
announceAvatarUrl + '" ' \
announceAvatarUrl + '" ' + \
'title="' + translate[idx] + \
'" alt=" "' + avatarPosition + \
brokenLinkSubstitute + \
'/></a>\n </div>\n'
else:
titleStr += \
@ -959,6 +964,10 @@ def getPostTitleReplyHtml(baseDir: str,
logPostTiming(enableTimingLog, postStartTime, '13.8')
if replyAvatarUrl:
brokenLinkSubstitute = \
" onerror=\"this.onerror=null; this.src='" + \
iconsPath + "/avatar_default.png'\""
replyAvatarImageInPost = \
' <div class=' + \
'"timeline-avatar-reply">\n'
@ -979,8 +988,8 @@ def getPostTitleReplyHtml(baseDir: str,
translate['Show profile']
replyAvatarImageInPost += \
'" alt=" "' + \
avatarPosition + '/></a>\n' + \
' </div>\n'
avatarPosition + brokenLinkSubstitute + \
'/></a>\n </div>\n'
else:
inReplyTo = \
postJsonObject['object']['inReplyTo']