Don't include content for sensitive posts within opengraph

main
Bob Mottram 2021-11-07 16:02:38 +00:00
parent 50dbe63597
commit ba02bb5435
1 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str:
" <meta content=\"" + objJson['published'] + \ " <meta content=\"" + objJson['published'] + \
"\" property=\"og:published_time\" />\n" "\" property=\"og:published_time\" />\n"
if not objJson.get('attachment'): if not objJson.get('attachment'):
if objJson.get('content'): if objJson.get('content') and not objJson.get('sensitive'):
description = removeHtml(objJson['content']) description = removeHtml(objJson['content'])
metadata += \ metadata += \
" <meta content=\"" + description + \ " <meta content=\"" + description + \
@ -137,7 +137,7 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str:
elif attachJson['mediaType'].startswith('audio/'): elif attachJson['mediaType'].startswith('audio/'):
description = 'Attached: 1 audio' description = 'Attached: 1 audio'
if description: if description:
if objJson.get('content'): if objJson.get('content') and not objJson.get('sensitive'):
description += '\n\n' + removeHtml(objJson['content']) description += '\n\n' + removeHtml(objJson['content'])
metadata += \ metadata += \
" <meta content=\"" + description + \ " <meta content=\"" + description + \