From d5459e1fabbae2f3e9df7df1e430b2048aea7257 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 9 Apr 2024 17:24:08 +0100 Subject: [PATCH] SHOW MOVE removed in conversation view for text mode browsers --- daemon_get.py | 2 +- daemon_get_post.py | 5 +++-- webapp_conversation.py | 9 ++++++++- webapp_timeline.py | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/daemon_get.py b/daemon_get.py index 28604f806..98ed67e27 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -573,7 +573,7 @@ def daemon_http_get(self) -> None: self.server.port, self.server.debug, self.server.session, - cookie): + cookie, ua_str): fitness_performance(getreq_start_time, self.server.fitness, '_GET', '_show_conversation_thread', self.server.debug) diff --git a/daemon_get_post.py b/daemon_get_post.py index 0caa29617..fba0f2748 100644 --- a/daemon_get_post.py +++ b/daemon_get_post.py @@ -995,7 +995,7 @@ def show_conversation_thread(self, authorized: bool, base_dir: str, http_prefix: str, domain: str, port: int, debug: str, curr_session, - cookie: str) -> bool: + cookie: str, ua_str: str) -> bool: """get conversation thread from the date link on a post """ if not path.startswith('/users/'): @@ -1056,7 +1056,8 @@ def show_conversation_thread(self, authorized: bool, self.server.buy_sites, self.server.blocked_cache, self.server.block_federated, - self.server.auto_cw_cache) + self.server.auto_cw_cache, + ua_str) if conv_str: msg = conv_str.encode('utf-8') msglen = len(msg) diff --git a/webapp_conversation.py b/webapp_conversation.py index 178584c71..98b4d9862 100644 --- a/webapp_conversation.py +++ b/webapp_conversation.py @@ -16,6 +16,7 @@ from utils import get_domain_from_actor from utils import is_public_post from utils import get_attributed_to from blocking import is_blocked +from webapp_utils import text_mode_browser from webapp_utils import html_header_with_external_style from webapp_utils import html_post_separator from webapp_utils import html_footer @@ -50,7 +51,8 @@ def html_conversation_view(authorized: bool, post_id: str, debug: bool, buy_sites: {}, blocked_cache: [], block_federated: [], - auto_cw_cache: {}) -> str: + auto_cw_cache: {}, + ua_str: str) -> str: """Show a page containing a conversation thread """ conv_posts = \ @@ -125,5 +127,10 @@ def html_conversation_view(authorized: bool, post_id: str, if post_str: conv_str += text_mode_separator + separator_str + post_str + # if using a text mode browser then don't show SHOW MORE because there + # is no way to hide/expand sections + if text_mode_browser(ua_str): + conv_str = conv_str.replace(translate['SHOW MORE'], '') + conv_str += text_mode_separator + html_footer() return conv_str diff --git a/webapp_timeline.py b/webapp_timeline.py index f610b8e67..ad880db81 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -835,7 +835,7 @@ def html_timeline(default_timeline: str, # left column left_column_str = '' - if not text_mode_browser(ua_str): + if not is_text_browser: left_column_str = \ get_left_column_content(base_dir, nickname, domain_full, http_prefix, translate,