From ba02bb5435670f4a0cf56941df98c31f072c376f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 7 Nov 2021 16:02:38 +0000 Subject: [PATCH 1/2] Don't include content for sensitive posts within opengraph --- webapp_post.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index c778aeda5..90b55cbaa 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -109,7 +109,7 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str: " \n" if not objJson.get('attachment'): - if objJson.get('content'): + if objJson.get('content') and not objJson.get('sensitive'): description = removeHtml(objJson['content']) metadata += \ " str: elif attachJson['mediaType'].startswith('audio/'): description = 'Attached: 1 audio' if description: - if objJson.get('content'): + if objJson.get('content') and not objJson.get('sensitive'): description += '\n\n' + removeHtml(objJson['content']) metadata += \ " Date: Sun, 7 Nov 2021 16:05:29 +0000 Subject: [PATCH 2/2] Don't include attachments for sensitive posts in opengraph --- webapp_post.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp_post.py b/webapp_post.py index 90b55cbaa..e2c821748 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -108,7 +108,7 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str: metadata += \ " \n" - if not objJson.get('attachment'): + if not objJson.get('attachment') or objJson.get('sensitive'): if objJson.get('content') and not objJson.get('sensitive'): description = removeHtml(objJson['content']) metadata += \