Display reply avatar

main2
Bob Mottram 2019-09-24 12:05:47 +01:00
parent 7962de5667
commit 5aca1d4999
1 changed files with 11 additions and 1 deletions

View File

@ -1789,6 +1789,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
if showDMicon: if showDMicon:
titleStr=titleStr+' <img src="/'+iconsDir+'/dm.png" class="DMicon"/>' titleStr=titleStr+' <img src="/'+iconsDir+'/dm.png" class="DMicon"/>'
replyAvatarImageInPost=''
if showRepeatIcon: if showRepeatIcon:
if isAnnounced: if isAnnounced:
if postJsonObject['object'].get('attributedTo'): if postJsonObject['object'].get('attributedTo'):
@ -1820,6 +1821,15 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
replyDisplayName=getDisplayName(postJsonObject['object']['inReplyTo'],personCache) replyDisplayName=getDisplayName(postJsonObject['object']['inReplyTo'],personCache)
if replyDisplayName: if replyDisplayName:
titleStr+=' <img src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+replyDisplayName+'</a>' titleStr+=' <img src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+replyDisplayName+'</a>'
replyActor=postJsonObject['object']['inReplyTo'].split('/statuses/')[0]
replyAvatarUrl=getPersonAvatarUrl(baseDir,replyActor,personCache)
if replyAvatarUrl:
replyAvatarImageInPost= \
' <div class="timeline-avatar">' \
' <a href="'+replyActor+'">' \
' <img src="'+replyAvatarUrl+'" title="'+translate['Show profile']+'" alt="Avatar"'+avatarPosition+'/></a>' \
' </div>'
else: else:
titleStr+=' <img src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>' titleStr+=' <img src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
else: else:
@ -2042,7 +2052,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
return \ return \
'<div class="'+containerClass+'">\n'+ \ '<div class="'+containerClass+'">\n'+ \
avatarImageInPost+ \ avatarImageInPost+ \
'<p class="post-title">'+titleStr+'</p>'+ \ '<p class="post-title">'+titleStr+replyAvatarImageInPost+'</p>'+ \
contentStr+footerStr+ \ contentStr+footerStr+ \
'</div>\n' '</div>\n'