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.newswire,
self.server.block_federated,
self.server.mitm_servers)
self.server.mitm_servers,
ua_str)
self.server.postreq_busy = False
return

View File

@ -247,7 +247,8 @@ def _person_options_view(self, options_confirm_params: str,
cookie: str,
calling_domain: str,
curr_session, access_keys: {},
mitm_servers: []) -> bool:
mitm_servers: [],
ua_str: str) -> bool:
"""Person options screen, view button
See html_person_options
"""
@ -328,7 +329,8 @@ def _person_options_view(self, options_confirm_params: str,
max_shares_on_profile,
no_of_books,
auto_cw_cache,
mitm_servers)
mitm_servers,
ua_str)
if profile_str:
msg = profile_str.encode('utf-8')
msglen = len(msg)
@ -1289,7 +1291,8 @@ def person_options2(self, path: str,
default_post_language: str,
newswire: {},
block_federated: [],
mitm_servers: []) -> None:
mitm_servers: [],
ua_str: str) -> None:
"""Receive POST from person options screen
"""
page_number = 1
@ -1418,7 +1421,8 @@ def person_options2(self, path: str,
cookie,
calling_domain,
curr_session, access_keys,
mitm_servers):
mitm_servers,
ua_str):
return
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: {},
actor_str: str,
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
"""
remote_only = False
@ -601,7 +602,8 @@ def _receive_search_handle(self, search_str: str,
max_shares_on_profile,
no_of_books,
auto_cw_cache,
mitm_servers)
mitm_servers,
ua_str)
if profile_str:
msg = profile_str.encode('utf-8')
msglen = len(msg)
@ -997,7 +999,8 @@ def receive_search_query(self, calling_domain: str, cookie: str,
no_of_books,
auto_cw_cache, actor_str,
curr_session, access_keys,
mitm_servers):
mitm_servers,
ua_str):
return
elif (search_str.startswith(':') or
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_valid_date
from flags import is_premium_account
from utils import text_mode_removals
from utils import replace_strings
from utils import data_dir
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 is_following_actor
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 edit_number_field
from webapp_utils import html_keyboard_navigation
@ -249,7 +251,8 @@ def html_profile_after_search(authorized: bool,
max_shares_on_profile: int,
no_of_books: int,
auto_cw_cache: {},
mitm_servers: []) -> str:
mitm_servers: [],
ua_str: str) -> str:
"""Show a profile page after a search for a fediverse address
"""
http = False
@ -625,6 +628,9 @@ def html_profile_after_search(authorized: bool,
if i >= 8:
break
if text_mode_browser(ua_str):
profile_str = text_mode_removals(profile_str, translate)
instance_title = get_config_param(base_dir, 'instanceTitle')
preload_images = []
return html_header_with_external_style(css_filename,