Don't show reply icon for posts where comments are not enabled

merge-requests/30/head
Bob Mottram 2020-08-21 19:39:31 +01:00
parent c64a8aadc1
commit 109caa2d5d
1 changed files with 7 additions and 1 deletions

View File

@ -3828,7 +3828,13 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
iconsDir + '/dm.png" class="DMicon"/>\n'
replyStr = ''
if showIcons:
# check if replying is permitted
commentsEnabled = True
if 'commentsEnabled' in postJsonObject['object']:
if postJsonObject['object']['commentsEnabled'] is False:
commentsEnabled = False
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):