From 937225acc75ab0205674ade65431e2471f658393 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 30 May 2022 14:11:33 +0100 Subject: [PATCH] dont_at_me emoji can appear within summary --- desktop_client.py | 5 ++++- webapp_post.py | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index d14f0cb88..d57124023 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -1774,7 +1774,10 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str, post_content = '' if post_json_object['object'].get('content'): post_content = post_json_object['object']['content'] - if not disallow_reply(post_content): + post_summary = '' + if post_json_object['object'].get('summary'): + post_summary = post_json_object['object']['summary'] + if not disallow_reply(post_summary + ' ' + post_content): if post_json_object.get('id'): post_id = post_json_object['id'] subject = None diff --git a/webapp_post.py b/webapp_post.py index cc46eaae6..6125562dc 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -2057,6 +2057,7 @@ def individual_post_as_html(signing_priv_key_pem: str, if not content_str: return '' + summary_str = '' if content_str: # does an emoji indicate a no boost preference? # if so then don't show the repeat/announce icon @@ -2064,7 +2065,10 @@ def individual_post_as_html(signing_priv_key_pem: str, announce_str = '' # does an emoji indicate a no replies preference? # if so then don't show the reply icon - if disallow_reply(content_str): + summary_str = get_summary_from_post(post_json_object, system_language, + languages_understood) + content_all_str = str(summary_str) + ' ' + content_str + if disallow_reply(content_all_str): reply_str = '' new_footer_str = \ @@ -2083,8 +2087,9 @@ def individual_post_as_html(signing_priv_key_pem: str, if post_is_sensitive: footer_str = '
' + footer_str - summary_str = get_summary_from_post(post_json_object, system_language, - languages_understood) + if not summary_str: + summary_str = get_summary_from_post(post_json_object, system_language, + languages_understood) is_patch = is_git_patch(base_dir, nickname, domain, post_json_object['object']['type'], summary_str, content_str)