diff --git a/webapp_post.py b/webapp_post.py index a828c0e81..7a3ed4dd8 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -249,53 +249,55 @@ def getReplyIconHtml(nickname: str, isPublicRepeat: bool, """Returns html for the reply icon/button """ replyStr = '' - if showIcons and commentsEnabled: - # reply is permitted - create reply icon - replyToLink = postJsonObject['object']['id'] - if postJsonObject['object'].get('attributedTo'): - if isinstance(postJsonObject['object']['attributedTo'], str): - 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 + if not (showIcons and commentsEnabled): + return replyStr - replyStr = '' - if isPublicRepeat: + # reply is permitted - create reply icon + replyToLink = postJsonObject['object']['id'] + if postJsonObject['object'].get('attributedTo'): + if isinstance(postJsonObject['object']['attributedTo'], str): + 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 isPublicRepeat: + replyStr += \ + ' \n' + else: + if isDM(postJsonObject): replyStr += \ - ' \n' else: - if isDM(postJsonObject): - replyStr += \ - ' ' + \ - '\n' - else: - replyStr += \ - ' ' + \ - '\n' + replyStr += \ + ' ' + \ + '\n' - replyStr += \ - ' ' + \ - '' + \
-            translate['Reply to this post'] + \
-            ' |\n' + replyStr += \ + ' ' + \ + '' + \
+        translate['Reply to this post'] + \
+        ' |\n' return replyStr