main
Bob Mottram 2025-11-24 19:42:48 +00:00
parent e196332520
commit 5e324433e2
1 changed files with 11 additions and 28 deletions

View File

@ -1503,8 +1503,7 @@ def _get_post_title_announce_html(base_dir: str,
mitm: bool, mitm: bool,
mitm_servers: [], mitm_servers: [],
software_name: str, software_name: str,
mutuals_list: [], mutuals_list: []) -> (str, str, str, str):
is_text_mode: bool) -> (str, str, str, str):
"""Returns the announce title of a post containing names of participants """Returns the announce title of a post containing names of participants
x announces y x announces y
""" """
@ -1570,10 +1569,7 @@ def _get_post_title_announce_html(base_dir: str,
# add mutual icon to the display name # add mutual icon to the display name
mutual_prefix = '' mutual_prefix = ''
if announce_handle in mutuals_list: if announce_handle in mutuals_list:
if not is_text_mode: mutual_prefix = ''
mutual_prefix = ''
else:
mutual_prefix = translate['Mutual'] + ' '
_log_post_timing(enable_timing_log, post_start_time, '13.3.1') _log_post_timing(enable_timing_log, post_start_time, '13.3.1')
announce_display_name2 = mutual_prefix + announce_display_name announce_display_name2 = mutual_prefix + announce_display_name
@ -1712,17 +1708,13 @@ def _get_reply_html(translate: {},
post_json_object: {}, post_json_object: {},
reply_handle: str, reply_handle: str,
software_name: str, software_name: str,
mutuals_list: [], mutuals_list: []) -> str:
is_text_mode: bool) -> str:
"""Returns html title for a reply """Returns html title for a reply
""" """
# add mutual icon to the display name # add mutual icon to the display name
mutual_prefix = '' mutual_prefix = ''
if reply_handle in mutuals_list: if reply_handle in mutuals_list:
if not is_text_mode: mutual_prefix = ''
mutual_prefix = ''
else:
mutual_prefix = translate['Mutual'] + ' '
replying_to_str = _replying_to_with_scope(post_json_object, translate) replying_to_str = _replying_to_with_scope(post_json_object, translate)
post_bookmark = '#' + bookmark_from_id(in_reply_to) post_bookmark = '#' + bookmark_from_id(in_reply_to)
@ -1763,8 +1755,7 @@ def _get_post_title_reply_html(base_dir: str,
session, debug: bool, session, debug: bool,
mitm_servers: [], mitm_servers: [],
software_name: str, software_name: str,
mutuals_list: [], mutuals_list: []) -> (str, str, str, str):
is_text_mode: bool) -> (str, str, str, str):
"""Returns the reply title of a post containing names of participants """Returns the reply title of a post containing names of participants
x replies to y x replies to y
""" """
@ -1894,7 +1885,7 @@ def _get_post_title_reply_html(base_dir: str,
title_str += \ title_str += \
_get_reply_html(translate, in_reply_to, reply_display_name, _get_reply_html(translate, in_reply_to, reply_display_name,
nickname, post_json_object, reply_handle, nickname, post_json_object, reply_handle,
software_name, mutuals_list, is_text_mode) software_name, mutuals_list)
if mitm or reply_domain in mitm_servers: if mitm or reply_domain in mitm_servers:
title_str += mitm_warning_html(translate) title_str += mitm_warning_html(translate)
@ -1951,8 +1942,7 @@ def _get_post_title_html(base_dir: str,
debug: bool, debug: bool,
mitm_servers: [], mitm_servers: [],
software_name: str, software_name: str,
mutuals_list: [], mutuals_list: []) -> (str, str, str, str):
is_text_mode: bool) -> (str, str, str, str):
"""Returns the title of a post containing names of participants """Returns the title of a post containing names of participants
x replies to y, x announces y, etc x replies to y, x announces y, etc
""" """
@ -1981,8 +1971,7 @@ def _get_post_title_html(base_dir: str,
container_class, mitm, container_class, mitm,
mitm_servers, mitm_servers,
software_name, software_name,
mutuals_list, mutuals_list)
is_text_mode)
return _get_post_title_reply_html(base_dir, return _get_post_title_reply_html(base_dir,
http_prefix, http_prefix,
@ -2002,8 +1991,7 @@ def _get_post_title_html(base_dir: str,
session, debug, session, debug,
mitm_servers, mitm_servers,
software_name, software_name,
mutuals_list, mutuals_list)
is_text_mode)
def _get_footer_with_icons(show_icons: bool, def _get_footer_with_icons(show_icons: bool,
@ -2669,16 +2657,12 @@ def individual_post_as_html(signing_priv_key_pem: str,
mitm_str = ' ' + mitm_warning_html(translate) mitm_str = ' ' + mitm_warning_html(translate)
# get the list of mutuals for the current account # get the list of mutuals for the current account
is_text_mode = text_mode_browser(ua_str)
mutuals_list = get_mutuals_of_person(base_dir, nickname, domain) mutuals_list = get_mutuals_of_person(base_dir, nickname, domain)
# add mutual icon to the display name # add mutual icon to the display name
mutual_prefix = '' mutual_prefix = ''
if actor_handle in mutuals_list: if actor_handle in mutuals_list:
if not is_text_mode: mutual_prefix = ''
mutual_prefix = ''
else:
mutual_prefix = translate['Mutual'] + ' '
if display_name: if display_name:
display_name = _enforce_max_display_name_length(display_name) display_name = _enforce_max_display_name_length(display_name)
@ -2916,8 +2900,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
session, False, session, False,
mitm_servers, mitm_servers,
software_name, software_name,
mutuals_list, mutuals_list)
is_text_mode)
title_str += title_str2 title_str += title_str2
_log_post_timing(enable_timing_log, post_start_time, '14') _log_post_timing(enable_timing_log, post_start_time, '14')