From 109caa2d5df145e8a79ed3bf05867fa62aa4cace Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 21 Aug 2020 19:39:31 +0100 Subject: [PATCH] Don't show reply icon for posts where comments are not enabled --- webinterface.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webinterface.py b/webinterface.py index 79205e8c6..6d766c8fe 100644 --- a/webinterface.py +++ b/webinterface.py @@ -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):