From 8de356ff9a8af184540ec8f9032a28f7ad26e10a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 18 Dec 2024 10:43:39 +0000 Subject: [PATCH] Add mitm warning icons for posts lacking a clear path separator --- webapp_post.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 612f9475d..3b1967892 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1554,15 +1554,19 @@ def _reply_to_unknown_html(translate: {}, def _reply_with_unknown_path_html(translate: {}, post_json_object: {}, post_domain: str, - nickname: str) -> str: + nickname: str, + mitm_servers: []) -> str: """Returns html title for a reply with an unknown path - eg. does not contain /statuses/ + eg. does not contain /statuses/ or an equivalent separator """ replying_to_str = _replying_to_with_scope(post_json_object, translate) post_id = get_reply_to(post_json_object['object']) post_bookmark = '#' + bookmark_from_id(post_id) post_link = '/users/' + nickname + '?convthread=' + \ post_id.replace('--', '/') + post_bookmark + mitm_str = '' + if post_domain in mitm_servers: + mitm_str = ' ' + mitm_warning_html(translate) return ' ' + replying_to_str + \
@@ -1570,7 +1574,7 @@ def _reply_with_unknown_path_html(translate: {},
         'class=\n' + \ ' ' + \ - post_domain + '\n' + post_domain + mitm_str + '\n' def _get_reply_html(translate: {}, @@ -1681,7 +1685,7 @@ def _get_post_title_reply_html(base_dir: str, title_str += \ _reply_with_unknown_path_html(translate, post_json_object, post_domain, - nickname) + nickname, mitm_servers) return (title_str, reply_avatar_image_in_post, container_class_icons, container_class)