From a49e27643ec566c2ea0968a6d60e11ee0ffcb44c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 18 Feb 2020 10:04:31 +0000 Subject: [PATCH] Sensitive posts should have a summary --- webinterface.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/webinterface.py b/webinterface.py index a6f83c8e..c6670c8f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2649,11 +2649,14 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ footerStr+=''+publishedStr+'\n' footerStr+='' - if not postJsonObject['object'].get('sensitive'): - postJsonObject['object']['sensitive']=False - + postIsSensitive=False + if postJsonObject['object'].get('sensitive'): + # sensitive posts should have a summary + if postJsonObject['object'].get('summary'): + postIsSensitive=postJsonObject['object']['sensitive'] + # add an extra line if there is a content warning, for better vertical spacing on mobile - if postJsonObject['object']['sensitive']: + if postIsSensitive: footerStr='
'+footerStr if not postJsonObject['object'].get('summary'): @@ -2662,7 +2665,7 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ if not postJsonObject['object'].get('content'): return '' objectContent=removeLongWords(postJsonObject['object']['content'],40,[]) - if not postJsonObject['object']['sensitive']: + if not postIsSensitive: contentStr=objectContent+attachmentStr contentStr=addEmbeddedElements(translate,contentStr) contentStr=insertQuestion(baseDir,translate,nickname,domain,port, \