diff --git a/webinterface.py b/webinterface.py index 4b68f2566..11a7cad61 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2100,7 +2100,41 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ pageNumberParam='' if pageNumber: pageNumberParam='?page='+str(pageNumber) - + + replyStr='' + if showIcons: + replyToLink=postJsonObject['object']['id'] + if postJsonObject['object'].get('attributedTo'): + replyToLink+='?mention='+postJsonObject['object']['attributedTo'] + if postJsonObject['object'].get('content'): + mentionedActors=getMentionsFromHtml(postJsonObject['object']['content']) + if mentionedActors: + for actorUrl in mentionedActors: + if '?mention='+actorUrl not in replyToLink: + replyToLink+='?mention='+actorUrl + if len(replyToLink)>500: + break + replyToLink+=pageNumberParam + + replyStr='' + if not isModerationPost and showRepeatIcon: + if not manuallyApprovesFollowers: + replyStr+= \ + '' + else: + replyStr+= \ + '' + else: + replyStr+= \ + '' + replyStr+=''+translate['Reply to this post']+' |' + announceStr='' if not isModerationPost and showRepeatIcon: # don't allow announce/repeat of your own posts @@ -2265,7 +2299,7 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ galleryStr+=' \n' galleryStr+=' \n' galleryStr+='
\n' - galleryStr+=' '+announceStr+likeStr+bookmarkStr+deleteStr+'\n' + galleryStr+=' '+replyStr+announceStr+likeStr+bookmarkStr+deleteStr+'\n' galleryStr+='
\n' if postJsonObject['object'].get('url'): imagePostUrl=postJsonObject['object']['url'] @@ -2379,38 +2413,8 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ containerClass='container dm' if showIcons: - replyToLink=postJsonObject['object']['id'] - if postJsonObject['object'].get('attributedTo'): - replyToLink+='?mention='+postJsonObject['object']['attributedTo'] - if postJsonObject['object'].get('content'): - mentionedActors=getMentionsFromHtml(postJsonObject['object']['content']) - if mentionedActors: - for actorUrl in mentionedActors: - if '?mention='+actorUrl not in replyToLink: - replyToLink+='?mention='+actorUrl - if len(replyToLink)>500: - break - replyToLink+=pageNumberParam - footerStr='
' - if not isModerationPost and showRepeatIcon: - if not manuallyApprovesFollowers: - footerStr+= \ - '' - else: - footerStr+= \ - '' - else: - footerStr+= \ - '' - footerStr+=''+translate['Reply to this post']+' |' - footerStr+=announceStr+likeStr+bookmarkStr+deleteStr + footerStr+=replyStr+announceStr+likeStr+bookmarkStr+deleteStr footerStr+=''+publishedStr+'' footerStr+='
'