Text mode removals on profile after search

main
Bob Mottram 2024-12-19 10:25:24 +00:00
parent dc36b23f14
commit bcbf7bd610
4 changed files with 23 additions and 9 deletions

View File

@ -737,7 +737,8 @@ def daemon_http_post(self) -> None:
self.server.default_post_language, self.server.default_post_language,
self.server.newswire, self.server.newswire,
self.server.block_federated, self.server.block_federated,
self.server.mitm_servers) self.server.mitm_servers,
ua_str)
self.server.postreq_busy = False self.server.postreq_busy = False
return return

View File

@ -247,7 +247,8 @@ def _person_options_view(self, options_confirm_params: str,
cookie: str, cookie: str,
calling_domain: str, calling_domain: str,
curr_session, access_keys: {}, curr_session, access_keys: {},
mitm_servers: []) -> bool: mitm_servers: [],
ua_str: str) -> bool:
"""Person options screen, view button """Person options screen, view button
See html_person_options See html_person_options
""" """
@ -328,7 +329,8 @@ def _person_options_view(self, options_confirm_params: str,
max_shares_on_profile, max_shares_on_profile,
no_of_books, no_of_books,
auto_cw_cache, auto_cw_cache,
mitm_servers) mitm_servers,
ua_str)
if profile_str: if profile_str:
msg = profile_str.encode('utf-8') msg = profile_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -1289,7 +1291,8 @@ def person_options2(self, path: str,
default_post_language: str, default_post_language: str,
newswire: {}, newswire: {},
block_federated: [], block_federated: [],
mitm_servers: []) -> None: mitm_servers: [],
ua_str: str) -> None:
"""Receive POST from person options screen """Receive POST from person options screen
""" """
page_number = 1 page_number = 1
@ -1418,7 +1421,8 @@ def person_options2(self, path: str,
cookie, cookie,
calling_domain, calling_domain,
curr_session, access_keys, curr_session, access_keys,
mitm_servers): mitm_servers,
ua_str):
return return
if _person_option_receive_petname(self, options_confirm_params, if _person_option_receive_petname(self, options_confirm_params,

View File

@ -445,7 +445,8 @@ def _receive_search_handle(self, search_str: str,
auto_cw_cache: {}, auto_cw_cache: {},
actor_str: str, actor_str: str,
curr_session, access_keys: {}, curr_session, access_keys: {},
mitm_servers: []) -> bool: mitm_servers: [],
ua_str: str) -> bool:
"""Receive a search for a fediverse handle or url from the search screen """Receive a search for a fediverse handle or url from the search screen
""" """
remote_only = False remote_only = False
@ -601,7 +602,8 @@ def _receive_search_handle(self, search_str: str,
max_shares_on_profile, max_shares_on_profile,
no_of_books, no_of_books,
auto_cw_cache, auto_cw_cache,
mitm_servers) mitm_servers,
ua_str)
if profile_str: if profile_str:
msg = profile_str.encode('utf-8') msg = profile_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -997,7 +999,8 @@ def receive_search_query(self, calling_domain: str, cookie: str,
no_of_books, no_of_books,
auto_cw_cache, actor_str, auto_cw_cache, actor_str,
curr_session, access_keys, curr_session, access_keys,
mitm_servers): mitm_servers,
ua_str):
return return
elif (search_str.startswith(':') or elif (search_str.startswith(':') or
search_str.endswith(' emoji')): search_str.endswith(' emoji')):

View File

@ -16,6 +16,7 @@ from flags import is_system_account
from flags import is_group_account from flags import is_group_account
from flags import is_valid_date from flags import is_valid_date
from flags import is_premium_account from flags import is_premium_account
from utils import text_mode_removals
from utils import replace_strings from utils import replace_strings
from utils import data_dir from utils import data_dir
from utils import time_days_ago from utils import time_days_ago
@ -88,6 +89,7 @@ from follow import is_follower_of_person
from follow import get_follower_domains from follow import get_follower_domains
from follow import is_following_actor from follow import is_following_actor
from webapp_frontscreen import html_front_screen from webapp_frontscreen import html_front_screen
from webapp_utils import text_mode_browser
from webapp_utils import html_following_dropdown from webapp_utils import html_following_dropdown
from webapp_utils import edit_number_field from webapp_utils import edit_number_field
from webapp_utils import html_keyboard_navigation from webapp_utils import html_keyboard_navigation
@ -249,7 +251,8 @@ def html_profile_after_search(authorized: bool,
max_shares_on_profile: int, max_shares_on_profile: int,
no_of_books: int, no_of_books: int,
auto_cw_cache: {}, auto_cw_cache: {},
mitm_servers: []) -> str: mitm_servers: [],
ua_str: str) -> str:
"""Show a profile page after a search for a fediverse address """Show a profile page after a search for a fediverse address
""" """
http = False http = False
@ -625,6 +628,9 @@ def html_profile_after_search(authorized: bool,
if i >= 8: if i >= 8:
break break
if text_mode_browser(ua_str):
profile_str = text_mode_removals(profile_str, translate)
instance_title = get_config_param(base_dir, 'instanceTitle') instance_title = get_config_param(base_dir, 'instanceTitle')
preload_images = [] preload_images = []
return html_header_with_external_style(css_filename, return html_header_with_external_style(css_filename,