From 7f1e23c013f133dcda5debb14d9bff4455cc4f97 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 24 Mar 2022 13:14:41 +0000 Subject: [PATCH] Bold reading accessibility feature --- content.py | 37 ++++++ daemon.py | 260 +++++++++++++++++++++++++++++++++++------- inbox.py | 87 +++++++++----- outbox.py | 6 +- tests.py | 35 ++++++ translations/ar.json | 3 +- translations/ca.json | 3 +- translations/cy.json | 3 +- translations/de.json | 3 +- translations/en.json | 3 +- translations/es.json | 3 +- translations/fr.json | 3 +- translations/ga.json | 3 +- translations/hi.json | 3 +- translations/it.json | 3 +- translations/ja.json | 3 +- translations/ko.json | 3 +- translations/ku.json | 3 +- translations/oc.json | 3 +- translations/pl.json | 3 +- translations/pt.json | 3 +- translations/ru.json | 3 +- translations/sw.json | 3 +- translations/uk.json | 3 +- translations/zh.json | 3 +- utils.py | 18 +++ webapp_confirm.py | 8 +- webapp_create_post.py | 5 +- webapp_frontscreen.py | 10 +- webapp_likers.py | 3 +- webapp_moderation.py | 4 +- webapp_post.py | 30 +++-- webapp_profile.py | 30 +++-- webapp_search.py | 9 +- webapp_timeline.py | 54 +++++---- 35 files changed, 506 insertions(+), 150 deletions(-) diff --git a/content.py b/content.py index 5bebdb0de..c2aad31ac 100644 --- a/content.py +++ b/content.py @@ -1323,3 +1323,40 @@ def contains_invalid_local_links(content: str) -> bool: if '?' + inv_str + '=' in content: return True return False + + +def bold_reading_string(text: str) -> str: + """Returns bold reading formatted text + """ + add_paragraph_markup = False + if '

' in text: + text = text.replace('

', '\n').replace('

', '') + add_paragraph_markup = True + paragraphs = text.split('\n') + parag_ctr = 0 + new_text = '' + for parag in paragraphs: + words = parag.split(' ') + new_parag = '' + for wrd in words: + if len(wrd) > 1 and '<' not in wrd and '>' not in wrd: + initial_chars = int(len(wrd) / 2) + new_parag += \ + '' + wrd[:initial_chars] + '' + \ + wrd[initial_chars:] + ' ' + else: + new_parag += wrd + ' ' + parag_ctr += 1 + new_parag = new_parag.strip() + if parag_ctr < len(paragraphs): + if not add_paragraph_markup: + new_text += new_parag + '\n' + else: + new_text += '

' + new_parag + '

' + else: + if not add_paragraph_markup: + new_text += new_parag + else: + new_text += '

' + new_parag + '

' + + return new_text diff --git a/daemon.py b/daemon.py index 68a00c0dc..22de6d91b 100644 --- a/daemon.py +++ b/daemon.py @@ -283,6 +283,7 @@ from utils import get_occupation_skills from utils import get_occupation_name from utils import set_occupation_name from utils import load_translations_from_file +from utils import load_bold_reading from utils import get_local_network_addresses from utils import decoded_host from utils import is_public_post @@ -3034,6 +3035,11 @@ class PubServer(BaseHTTPRequestHandler): custom_submit_text = get_config_param(base_dir, 'customSubmitText') conversation_id = None reply_is_chat = False + + bold_reading = False + if self.server.bold_reading(chooser_nickname): + bold_reading = True + msg = html_new_post(self.server.css_cache, False, self.server.translate, base_dir, @@ -3069,7 +3075,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.default_timeline, - reply_is_chat).encode('utf-8') + reply_is_chat, + bold_reading).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -3173,6 +3180,11 @@ class PubServer(BaseHTTPRequestHandler): custom_submit_text = get_config_param(base_dir, 'customSubmitText') conversation_id = None reply_is_chat = False + + bold_reading = False + if self.server.bold_reading.get(chooser_nickname): + bold_reading = True + msg = html_new_post(self.server.css_cache, False, self.server.translate, base_dir, @@ -3207,7 +3219,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.default_timeline, - reply_is_chat).encode('utf-8') + reply_is_chat, + bold_reading).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -3704,6 +3717,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True hashtag_str = \ html_hashtag_search(self.server.css_cache, nickname, domain, port, @@ -3729,7 +3745,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) if hashtag_str: msg = hashtag_str.encode('utf-8') msglen = len(msg) @@ -3806,6 +3822,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True history_str = \ html_history_search(self.server.css_cache, self.server.translate, @@ -3834,7 +3853,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) if history_str: msg = history_str.encode('utf-8') msglen = len(msg) @@ -3884,6 +3903,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True bookmarks_str = \ html_history_search(self.server.css_cache, self.server.translate, @@ -3912,7 +3934,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) if bookmarks_str: msg = bookmarks_str.encode('utf-8') msglen = len(msg) @@ -4046,6 +4068,10 @@ class PubServer(BaseHTTPRequestHandler): self.server.postreq_busy = False return + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True + profile_str = \ html_profile_after_search(self.server.css_cache, recent_posts_cache, @@ -4078,7 +4104,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.lists_enabled, timezone, self.server.onion_domain, - self.server.i2p_domain) + self.server.i2p_domain, + bold_reading) if profile_str: msg = profile_str.encode('utf-8') msglen = len(msg) @@ -6655,6 +6682,33 @@ class PubServer(BaseHTTPRequestHandler): 'unable to delete ' + hide_reaction_button_file) + # bold reading checkbox + bold_reading_filename = \ + acct_dir(base_dir, nickname, domain) + \ + '/.boldReading' + bold_reading = False + if fields.get('boldReading'): + if fields['boldReading'] == 'on': + bold_reading = True + self.server.bold_reading[nickname] = True + try: + with open(bold_reading_filename, + 'w+') as rfile: + rfile.write('\n') + except OSError: + print('EX: unable to write bold reading ' + + bold_reading_filename) + if not bold_reading: + if self.server.bold_reading[nickname]: + del self.server.bold_reading[nickname] + if os.path.isfile(bold_reading_filename): + try: + os.remove(bold_reading_filename) + except OSError: + print('EX: _profile_edit ' + + 'unable to delete ' + + bold_reading_filename) + # notify about new Likes if on_final_welcome_screen: # default setting from welcome screen @@ -8204,6 +8258,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True hashtag_str = \ html_hashtag_search(self.server.css_cache, nickname, domain, port, @@ -8228,7 +8285,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) if hashtag_str: msg = hashtag_str.encode('utf-8') msglen = len(msg) @@ -8445,6 +8502,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(announce_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, self.server.max_recent_posts, @@ -8473,7 +8533,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) actor_absolute = self._get_instance_url(calling_domain) + actor actor_path_str = \ @@ -8986,6 +9046,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(liked_post_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -9016,7 +9079,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Liked post not found: ' + liked_post_filename) # clear the icon from the cache so that it gets updated @@ -9168,6 +9231,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(liked_post_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -9198,7 +9264,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Unliked post not found: ' + liked_post_filename) # clear the icon from the cache so that it gets updated @@ -9379,6 +9445,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(reaction_post_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -9409,7 +9478,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Emoji reaction post not found: ' + reaction_post_filename) @@ -9580,6 +9649,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(reaction_post_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -9610,7 +9682,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Unreaction post not found: ' + reaction_post_filename) @@ -9687,6 +9759,11 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(self.post_to_nickname): timezone = \ self.server.account_timezone.get(self.post_to_nickname) + + bold_reading = False + if self.server.bold_reading.get(self.post_to_nickname): + bold_reading = True + msg = \ html_emoji_reaction_picker(self.server.css_cache, self.server.recent_posts_cache, @@ -9712,7 +9789,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, timeline_str, page_number, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -9831,6 +9908,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(bookmark_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -9861,7 +9941,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Bookmarked post not found: ' + bookmark_filename) # self._post_to_outbox(bookmark_json, @@ -9987,6 +10067,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(bookmark_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(self.post_to_nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, False, self.server.recent_posts_cache, @@ -10017,7 +10100,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Unbookmarked post not found: ' + bookmark_filename) @@ -10107,7 +10190,8 @@ class PubServer(BaseHTTPRequestHandler): return delete_str = \ - html_confirm_delete(self.server.css_cache, + html_confirm_delete(self.server, + self.server.css_cache, self.server.recent_posts_cache, self.server.max_recent_posts, self.server.translate, page_number, @@ -10219,6 +10303,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(mute_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, allow_downloads, self.server.recent_posts_cache, @@ -10250,7 +10337,7 @@ class PubServer(BaseHTTPRequestHandler): use_cache_only, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Muted post not found: ' + mute_filename) @@ -10343,6 +10430,9 @@ class PubServer(BaseHTTPRequestHandler): if os.path.isfile(mute_filename.replace('.json', '') + '.mitm'): mitm = True + bionic_reading = False + if self.server.bionic_reading.get(nickname): + bionic_reading = True individual_post_as_html(self.server.signing_priv_key_pem, allow_downloads, self.server.recent_posts_cache, @@ -10374,7 +10464,7 @@ class PubServer(BaseHTTPRequestHandler): use_cache_only, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bionic_reading) else: print('WARN: Unmuted post not found: ' + mute_filename) if calling_domain.endswith('.onion') and onion_domain: @@ -10475,6 +10565,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_post_replies(self.server.css_cache, recent_posts_cache, @@ -10501,7 +10594,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -10577,6 +10670,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_post_replies(self.server.css_cache, recent_posts_cache, @@ -10603,7 +10699,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -10692,6 +10788,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -10725,7 +10824,7 @@ class PubServer(BaseHTTPRequestHandler): None, None, self.server.cw_lists, self.server.lists_enabled, self.server.content_license_url, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -10821,6 +10920,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nick): timezone = \ self.server.account_timezone.get(nick) + bold_reading = False + if self.server.bold_reading.get(nick): + bold_reading = True msg = \ html_profile(signing_priv_key_pem, self.server.rss_icon_at_top, @@ -10855,7 +10957,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, content_license_url, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -10995,6 +11097,10 @@ class PubServer(BaseHTTPRequestHandler): post_url = post_url.split('?')[0] post_url = post_url.replace('--', '/') + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True + msg = \ html_likers_of_post(base_dir, nickname, domain, port, post_url, self.server.translate, @@ -11017,7 +11123,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - 'inbox', self.server.default_timeline) + 'inbox', self.server.default_timeline, + bold_reading) if not msg: self._404() return True @@ -11056,6 +11163,10 @@ class PubServer(BaseHTTPRequestHandler): post_url = post_url.split('?')[0] post_url = post_url.replace('--', '/') + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True + # note that the likers function is reused, but with 'shares' msg = \ html_likers_of_post(base_dir, nickname, domain, port, @@ -11080,7 +11191,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, 'inbox', self.server.default_timeline, - 'shares') + bold_reading, 'shares') if not msg: self._404() return True @@ -11134,10 +11245,16 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + mitm = False if os.path.isfile(post_filename.replace('.json', '') + '.mitm'): mitm = True + + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True + msg = \ html_individual_post(self.server.css_cache, self.server.recent_posts_cache, @@ -11164,7 +11281,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone, mitm) + timezone, mitm, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -11408,6 +11525,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = html_inbox(self.server.css_cache, default_timeline, recent_posts_cache, @@ -11448,7 +11568,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) if getreq_start_time: fitness_performance(getreq_start_time, self.server.fitness, @@ -11576,6 +11696,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_inbox_dms(self.server.css_cache, self.server.default_timeline, @@ -11616,7 +11739,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -11733,6 +11856,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_inbox_replies(self.server.css_cache, self.server.default_timeline, @@ -11773,7 +11899,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -11887,6 +12013,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True msg = \ html_inbox_media(self.server.css_cache, self.server.default_timeline, @@ -11928,7 +12057,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12042,6 +12171,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_inbox_blogs(self.server.css_cache, self.server.default_timeline, @@ -12083,7 +12215,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12205,6 +12337,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_inbox_news(self.server.css_cache, self.server.default_timeline, @@ -12247,7 +12382,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12372,6 +12507,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_inbox_features(self.server.css_cache, self.server.default_timeline, @@ -12414,7 +12552,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12493,6 +12631,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_shares(self.server.css_cache, self.server.default_timeline, @@ -12530,7 +12671,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.shared_items_federated_domains, self.server.signing_priv_key_pem, self.server.cw_lists, - self.server.lists_enabled, timezone) + self.server.lists_enabled, timezone, + bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12583,6 +12725,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_wanted(self.server.css_cache, self.server.default_timeline, @@ -12621,7 +12766,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12714,6 +12859,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_bookmarks(self.server.css_cache, self.server.default_timeline, @@ -12755,7 +12903,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12864,6 +13012,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_outbox(self.server.css_cache, self.server.default_timeline, @@ -12903,7 +13054,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -13008,6 +13159,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_moderation(self.server.css_cache, self.server.default_timeline, @@ -13048,7 +13202,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.signing_priv_key_pem, self.server.cw_lists, self.server.lists_enabled, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -13151,6 +13305,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -13186,7 +13343,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.content_license_url, - timezone) + timezone, bold_reading) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -13287,6 +13444,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url shared_items_federated_domains = \ self.server.shared_items_federated_domains + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -13323,7 +13483,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, content_license_url, - timezone).encode('utf-8') + timezone, bold_reading).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -13422,6 +13582,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url shared_items_federated_domains = \ self.server.shared_items_federated_domains + bold_reading = False + if self.server.bold_reading(nickname): + bold_reading = True msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -13459,7 +13622,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, content_license_url, - timezone).encode('utf-8') + timezone, bold_reading).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -13583,6 +13746,9 @@ class PubServer(BaseHTTPRequestHandler): if self.server.account_timezone.get(nickname): timezone = \ self.server.account_timezone.get(nickname) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -13615,7 +13781,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.content_license_url, - timezone).encode('utf-8') + timezone, bold_reading).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -14371,6 +14537,10 @@ class PubServer(BaseHTTPRequestHandler): if reply_post_filename: post_json_object = load_json(reply_post_filename) + bold_reading = False + if self.server.bold_reading.get(nickname): + bold_reading = True + msg = html_new_post(self.server.css_cache, media_instance, translate, @@ -14408,7 +14578,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.cw_lists, self.server.lists_enabled, self.server.default_timeline, - reply_is_chat).encode('utf-8') + reply_is_chat, + bold_reading).encode('utf-8') if not msg: print('Error replying to ' + in_reply_to_url) self._404() @@ -14476,7 +14647,7 @@ class PubServer(BaseHTTPRequestHandler): access_keys = self.server.key_shortcuts[nickname] default_reply_interval_hrs = self.server.default_reply_interval_hrs - msg = html_edit_profile(self.server.css_cache, + msg = html_edit_profile(self.server, self.server.css_cache, translate, base_dir, path, domain, @@ -20523,6 +20694,9 @@ def run_daemon(crawlers_allowed: [], # scan the theme directory for any svg files containing scripts assert not scan_themes_for_scripts(base_dir) + # for each account, whether bold reading is enabled + httpd.bold_reading = load_bold_reading(base_dir) + httpd.account_timezone = load_account_timezones(base_dir) httpd.post_to_nickname = None diff --git a/inbox.py b/inbox.py index b02514e0e..561a09d80 100644 --- a/inbox.py +++ b/inbox.py @@ -297,7 +297,8 @@ def _inbox_store_post_to_html_cache(recent_posts_cache: {}, cw_lists: {}, lists_enabled: str, timezone: str, - mitm: bool) -> None: + mitm: bool, + bold_reading: bool) -> None: """Converts the json post into html and stores it in a cache This enables the post to be quickly displayed later """ @@ -322,7 +323,8 @@ def _inbox_store_post_to_html_cache(recent_posts_cache: {}, peertube_instances, allow_local_network_access, theme_name, system_language, max_like_count, not_dm, True, True, False, True, False, - cw_lists, lists_enabled, timezone, mitm) + cw_lists, lists_enabled, timezone, mitm, + bold_reading) def valid_inbox(base_dir: str, nickname: str, domain: str) -> bool: @@ -1047,7 +1049,8 @@ def _receive_like(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, + bold_reading: bool) -> bool: """Receives a Like activity within the POST section of HTTPServer """ if message_json['type'] != 'Like': @@ -1155,7 +1158,8 @@ def _receive_like(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) return True @@ -1174,7 +1178,8 @@ def _receive_undo_like(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, + bold_reading: bool) -> bool: """Receives an undo like activity within the POST section of HTTPServer """ if message_json['type'] != 'Undo': @@ -1272,7 +1277,8 @@ def _receive_undo_like(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) return True @@ -1292,7 +1298,7 @@ def _receive_reaction(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, bold_reading: bool) -> bool: """Receives an emoji reaction within the POST section of HTTPServer """ if message_json['type'] != 'EmojiReact': @@ -1422,7 +1428,8 @@ def _receive_reaction(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) return True @@ -1443,7 +1450,8 @@ def _receive_undo_reaction(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, + bold_reading: bool) -> bool: """Receives an undo emoji reaction within the POST section of HTTPServer """ if message_json['type'] != 'Undo': @@ -1559,7 +1567,8 @@ def _receive_undo_reaction(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) return True @@ -1577,7 +1586,7 @@ def _receive_bookmark(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: {}) -> bool: + lists_enabled: {}, bold_reading: bool) -> bool: """Receives a bookmark activity within the POST section of HTTPServer """ if not message_json.get('type'): @@ -1673,7 +1682,8 @@ def _receive_bookmark(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) return True @@ -1693,7 +1703,7 @@ def _receive_undo_bookmark(recent_posts_cache: {}, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, bold_reading: bool) -> bool: """Receives an undo bookmark activity within the POST section of HTTPServer """ if not message_json.get('type'): @@ -1791,7 +1801,7 @@ def _receive_undo_bookmark(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, lists_enabled, - timezone, mitm) + timezone, mitm, bold_reading) return True @@ -1887,7 +1897,7 @@ def _receive_announce(recent_posts_cache: {}, allow_deletion: bool, peertube_instances: [], max_like_count: int, cw_lists: {}, - lists_enabled: str) -> bool: + lists_enabled: str, bold_reading: bool) -> bool: """Receives an announce activity within the POST section of HTTPServer """ if message_json['type'] != 'Announce': @@ -2010,7 +2020,8 @@ def _receive_announce(recent_posts_cache: {}, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) if not announce_html: print('WARN: Unable to generate html for announce ' + str(message_json)) @@ -3111,7 +3122,8 @@ def _receive_question_vote(server, base_dir: str, nickname: str, domain: str, allow_local_network_access: bool, theme_name: str, system_language: str, max_like_count: int, - cw_lists: {}, lists_enabled: bool) -> None: + cw_lists: {}, lists_enabled: bool, + bold_reading: bool) -> None: """Updates the votes on a Question/poll """ # if this is a reply to a question then update the votes @@ -3163,7 +3175,8 @@ def _receive_question_vote(server, base_dir: str, nickname: str, domain: str, show_individual_post_icons, manually_approve_followers, False, True, False, cw_lists, - lists_enabled, timezone, mitm) + lists_enabled, timezone, mitm, + bold_reading) # add id to inbox index inbox_update_index('inbox', base_dir, handle, @@ -3362,6 +3375,12 @@ def _inbox_after_initial(server, post_is_dm = False is_group = _group_handle(base_dir, handle) + handle_name = handle.split('@')[0] + + bold_reading = False + if server.bold_reading.get(handle_name): + bold_reading = True + if _receive_like(recent_posts_cache, session, handle, is_group, base_dir, http_prefix, @@ -3380,7 +3399,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Like accepted from ' + actor) return False @@ -3402,7 +3422,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Undo like accepted from ' + actor) return False @@ -3425,7 +3446,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Reaction accepted from ' + actor) return False @@ -3447,7 +3469,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Undo reaction accepted from ' + actor) return False @@ -3469,7 +3492,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Bookmark accepted from ' + actor) return False @@ -3491,7 +3515,8 @@ def _inbox_after_initial(server, peertube_instances, allow_local_network_access, theme_name, system_language, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Undo bookmark accepted from ' + actor) return False @@ -3517,7 +3542,8 @@ def _inbox_after_initial(server, max_recent_posts, allow_deletion, peertube_instances, - max_like_count, cw_lists, lists_enabled): + max_like_count, cw_lists, lists_enabled, + bold_reading): if debug: print('DEBUG: Announce accepted from ' + actor) @@ -3615,7 +3641,8 @@ def _inbox_after_initial(server, allow_local_network_access, theme_name, system_language, max_like_count, - cw_lists, lists_enabled) + cw_lists, lists_enabled, + bold_reading) is_reply_to_muted_post = False @@ -3718,11 +3745,10 @@ def _inbox_after_initial(server, print('Saving inbox post as html to cache') html_cache_start_time = time.time() - handle_name = handle.split('@')[0] allow_local_net_access = allow_local_network_access show_pub_date_only = show_published_date_only - timezone = get_account_timezone(base_dir, - handle_name, domain) + timezone = \ + get_account_timezone(base_dir, handle_name, domain) _inbox_store_post_to_html_cache(recent_posts_cache, max_recent_posts, translate, base_dir, @@ -3744,7 +3770,8 @@ def _inbox_after_initial(server, signing_priv_key_pem, cw_lists, lists_enabled, - timezone, mitm) + timezone, mitm, + bold_reading) if debug: time_diff = \ str(int((time.time() - html_cache_start_time) * diff --git a/outbox.py b/outbox.py index 3b8215d52..07d321aa8 100644 --- a/outbox.py +++ b/outbox.py @@ -461,6 +461,9 @@ def post_message_to_outbox(session, translate: {}, if os.path.isfile(saved_filename.replace('.json', '') + '.mitm'): mitm = True + bold_reading = False + if server.bold_reading.get(post_to_nickname): + bold_reading = True individual_post_as_html(signing_priv_key_pem, False, recent_posts_cache, max_recent_posts, @@ -485,7 +488,8 @@ def post_message_to_outbox(session, translate: {}, manually_approve_followers, False, True, use_cache_only, cw_lists, lists_enabled, - timezone, mitm) + timezone, mitm, + bold_reading) if outbox_announce(recent_posts_cache, base_dir, message_json, debug): diff --git a/tests.py b/tests.py index d23461a08..838c669d1 100644 --- a/tests.py +++ b/tests.py @@ -129,6 +129,7 @@ from inbox import json_post_allows_comments from inbox import valid_inbox from inbox import valid_inbox_filenames from categories import guess_hashtag_category +from content import bold_reading_string from content import safe_web_text from content import words_similarity from content import get_price_from_string @@ -6687,6 +6688,39 @@ def _test_published_to_local_timezone() -> None: assert local_time_str == 'Sat Feb 26, 05:15' +def _test_bold_reading() -> None: + print('bold_reading') + text = "This is a test of emboldening." + text_bold = bold_reading_string(text) + expected = \ + "This is a test of " + \ + "emboldening." + if text_bold != expected: + print(text_bold) + assert text_bold == expected + + text = "

This is a test of emboldening with paragraph.

" + text_bold = bold_reading_string(text) + expected = \ + "

This is a test of " + \ + "emboldening with paragraph.

" + if text_bold != expected: + print(text_bold) + assert text_bold == expected + + text = \ + "

This is a test of emboldening

" + \ + "

With more than one paragraph.

" + text_bold = bold_reading_string(text) + expected = \ + "

This is a test of " + \ + "emboldening

With more " + \ + "than one paragraph.

" + if text_bold != expected: + print(text_bold) + assert text_bold == expected + + def run_all_tests(): base_dir = os.getcwd() print('Running tests...') @@ -6703,6 +6737,7 @@ def run_all_tests(): 'message_json', 'liked_post_json']) _test_checkbox_names() _test_functions() + _test_bold_reading() _test_published_to_local_timezone() _test_safe_webtext() _test_get_link_from_rss_item() diff --git a/translations/ar.json b/translations/ar.json index 8a4d3c7ee..6f6f4ce23 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -518,5 +518,6 @@ "Register": "يسجل", "Web Bots Allowed": "مسموح روبوتات الويب", "Known Search Bots": "روبوتات بحث الويب المعروفة", - "mitm": "يمكن قراءة الرسالة أو تعديلها من قبل طرف ثالث" + "mitm": "يمكن قراءة الرسالة أو تعديلها من قبل طرف ثالث", + "Bold reading": "قراءة جريئة" } diff --git a/translations/ca.json b/translations/ca.json index 10dd483f7..86651c8ae 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -518,5 +518,6 @@ "Register": "Registra't", "Web Bots Allowed": "Bots web permesos", "Known Search Bots": "Bots de cerca web coneguts", - "mitm": "El missatge podria haver estat llegit o modificat per un tercer" + "mitm": "El missatge podria haver estat llegit o modificat per un tercer", + "Bold reading": "Lectura atrevida" } diff --git a/translations/cy.json b/translations/cy.json index eef7ecbd4..8bc01bdec 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -518,5 +518,6 @@ "Register": "Cofrestrwch", "Web Bots Allowed": "Web Bots a Ganiateir", "Known Search Bots": "Bots Chwilio Gwe Hysbys", - "mitm": "Gallai'r neges fod wedi cael ei darllen neu ei haddasu gan drydydd parti" + "mitm": "Gallai'r neges fod wedi cael ei darllen neu ei haddasu gan drydydd parti", + "Bold reading": "Darllen beiddgar" } diff --git a/translations/de.json b/translations/de.json index a33f20caf..c2fe3ff2d 100644 --- a/translations/de.json +++ b/translations/de.json @@ -518,5 +518,6 @@ "Register": "Registrieren", "Web Bots Allowed": "Webbots erlaubt", "Known Search Bots": "Bekannte Bots für die Websuche", - "mitm": "Die Nachricht könnte von einem Dritten gelesen oder geändert worden sein" + "mitm": "Die Nachricht könnte von einem Dritten gelesen oder geändert worden sein", + "Bold reading": "Mutige Lektüre" } diff --git a/translations/en.json b/translations/en.json index 848aeb093..d70f59477 100644 --- a/translations/en.json +++ b/translations/en.json @@ -518,5 +518,6 @@ "Register": "Register", "Web Bots Allowed": "Web Search Bots Allowed", "Known Search Bots": "Known Web Search Bots", - "mitm": "Message could have been read or modified by a third party" + "mitm": "Message could have been read or modified by a third party", + "Bold reading": "Bold reading" } diff --git a/translations/es.json b/translations/es.json index b611d7366..3c3673ee3 100644 --- a/translations/es.json +++ b/translations/es.json @@ -518,5 +518,6 @@ "Register": "Registrarse", "Web Bots Allowed": "Bots web permitidos", "Known Search Bots": "Bots de búsqueda web conocidos", - "mitm": "El mensaje podría haber sido leído o modificado por un tercero" + "mitm": "El mensaje podría haber sido leído o modificado por un tercero", + "Bold reading": "Lectura en negrita" } diff --git a/translations/fr.json b/translations/fr.json index f50d7a4d4..a553b49b8 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -518,5 +518,6 @@ "Register": "S'inscrire", "Web Bots Allowed": "Robots Web autorisés", "Known Search Bots": "Robots de recherche Web connus", - "mitm": "Le message a pu être lu ou modifié par un tiers" + "mitm": "Le message a pu être lu ou modifié par un tiers", + "Bold reading": "Lecture audacieuse" } diff --git a/translations/ga.json b/translations/ga.json index 7fdcece92..c1f065901 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -518,5 +518,6 @@ "Register": "Clár", "Web Bots Allowed": "Róbónna Gréasáin Ceadaithe", "Known Search Bots": "Róbónna Cuardach Gréasáin Aitheanta", - "mitm": "D'fhéadfadh tríú páirtí an teachtaireacht a léamh nó a mhodhnú" + "mitm": "D'fhéadfadh tríú páirtí an teachtaireacht a léamh nó a mhodhnú", + "Bold reading": "Léamh trom" } diff --git a/translations/hi.json b/translations/hi.json index 668b8aab6..6845d4d27 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -518,5 +518,6 @@ "Register": "रजिस्टर करें", "Web Bots Allowed": "वेब बॉट्स की अनुमति है", "Known Search Bots": "ज्ञात वेब खोज बॉट्स", - "mitm": "संदेश किसी तीसरे पक्ष द्वारा पढ़ा या संशोधित किया जा सकता था" + "mitm": "संदेश किसी तीसरे पक्ष द्वारा पढ़ा या संशोधित किया जा सकता था", + "Bold reading": "बोल्ड रीडिंग" } diff --git a/translations/it.json b/translations/it.json index 23e96d921..d6bd3418f 100644 --- a/translations/it.json +++ b/translations/it.json @@ -518,5 +518,6 @@ "Register": "Registrati", "Web Bots Allowed": "Web bot consentiti", "Known Search Bots": "Bot di ricerca Web noti", - "mitm": "Il messaggio potrebbe essere stato letto o modificato da terzi" + "mitm": "Il messaggio potrebbe essere stato letto o modificato da terzi", + "Bold reading": "Lettura audace" } diff --git a/translations/ja.json b/translations/ja.json index e722405f8..0d6fe2b7e 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -518,5 +518,6 @@ "Register": "登録", "Web Bots Allowed": "許可されたWebボット", "Known Search Bots": "既知のWeb検索ボット", - "mitm": "メッセージが第三者によって読み取られたり変更されたりした可能性があります" + "mitm": "メッセージが第三者によって読み取られたり変更されたりした可能性があります", + "Bold reading": "大胆な読書" } diff --git a/translations/ko.json b/translations/ko.json index e9bdb5d38..96b6e038a 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -518,5 +518,6 @@ "Register": "등록", "Web Bots Allowed": "웹 봇 허용", "Known Search Bots": "알려진 웹 검색 봇", - "mitm": "제3자가 메시지를 읽거나 수정했을 수 있습니다." + "mitm": "제3자가 메시지를 읽거나 수정했을 수 있습니다.", + "Bold reading": "굵은 글씨" } diff --git a/translations/ku.json b/translations/ku.json index e491e585c..2aa459238 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -518,5 +518,6 @@ "Register": "Fêhrist", "Web Bots Allowed": "Web Bots Destûrdar in", "Known Search Bots": "Botên Lêgerîna Webê yên naskirî", - "mitm": "Peyam dikaribû ji hêla aliyek sêyemîn ve were xwendin an guhertin" + "mitm": "Peyam dikaribû ji hêla aliyek sêyemîn ve were xwendin an guhertin", + "Bold reading": "Xwendina qelew" } diff --git a/translations/oc.json b/translations/oc.json index 5c0858299..c6e69765c 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -514,5 +514,6 @@ "Register": "Register", "Web Bots Allowed": "Web Search Bots Allowed", "Known Search Bots": "Known Web Search Bots", - "mitm": "Message could have been read or modified by a third party" + "mitm": "Message could have been read or modified by a third party", + "Bold reading": "Bold reading" } diff --git a/translations/pl.json b/translations/pl.json index 3184a3a52..fb6e675b1 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -518,5 +518,6 @@ "Register": "Zarejestrować", "Web Bots Allowed": "Dozwolone boty internetowe", "Known Search Bots": "Znane boty wyszukiwania w sieci", - "mitm": "Wiadomość mogła zostać przeczytana lub zmodyfikowana przez osobę trzecią" + "mitm": "Wiadomość mogła zostać przeczytana lub zmodyfikowana przez osobę trzecią", + "Bold reading": "Odważne czytanie" } diff --git a/translations/pt.json b/translations/pt.json index 5a543440b..98a6db584 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -518,5 +518,6 @@ "Register": "Registro", "Web Bots Allowed": "Webbots permitidos", "Known Search Bots": "Bots de pesquisa na Web conhecidos", - "mitm": "A mensagem pode ter sido lida ou modificada por terceiros" + "mitm": "A mensagem pode ter sido lida ou modificada por terceiros", + "Bold reading": "Leitura em negrito" } diff --git a/translations/ru.json b/translations/ru.json index b9540fc12..e8d906959 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -518,5 +518,6 @@ "Register": "регистр", "Web Bots Allowed": "Веб-боты разрешены", "Known Search Bots": "Известные боты веб-поиска", - "mitm": "Сообщение могло быть прочитано или изменено третьим лицом" + "mitm": "Сообщение могло быть прочитано или изменено третьим лицом", + "Bold reading": "Смелое чтение" } diff --git a/translations/sw.json b/translations/sw.json index 9f047b434..39e466044 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -518,5 +518,6 @@ "Register": "Sajili", "Web Bots Allowed": "Mtandao wa Boti Unaruhusiwa", "Known Search Bots": "Vijibu vya Utafutaji wa Wavuti vinavyojulikana", - "mitm": "Ujumbe ungeweza kusomwa au kurekebishwa na mtu mwingine" + "mitm": "Ujumbe ungeweza kusomwa au kurekebishwa na mtu mwingine", + "Bold reading": "Kusoma kwa ujasiri" } diff --git a/translations/uk.json b/translations/uk.json index 89e9273bd..009245795 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -518,5 +518,6 @@ "Register": "Реєстрація", "Web Bots Allowed": "Веб-боти дозволені", "Known Search Bots": "Відомі пошукові роботи в Інтернеті", - "mitm": "Повідомлення могло бути прочитане або змінене третьою стороною" + "mitm": "Повідомлення могло бути прочитане або змінене третьою стороною", + "Bold reading": "Сміливе читання" } diff --git a/translations/zh.json b/translations/zh.json index b0acdfbde..c9624fce1 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -518,5 +518,6 @@ "Register": "登记", "Web Bots Allowed": "允许网络机器人", "Known Search Bots": "已知的网络搜索机器人", - "mitm": "消息可能已被第三方阅读或修改" + "mitm": "消息可能已被第三方阅读或修改", + "Bold reading": "大胆阅读" } diff --git a/utils.py b/utils.py index 1cd72cbe7..e65cb083e 100644 --- a/utils.py +++ b/utils.py @@ -3480,6 +3480,24 @@ def load_account_timezones(base_dir: str) -> {}: return account_timezone +def load_bold_reading(base_dir: str) -> {}: + """Returns a dictionary containing the bold reading status for each account + """ + bold_reading = {} + for subdir, dirs, files in os.walk(base_dir + '/accounts'): + for acct in dirs: + if '@' not in acct: + continue + if acct.startswith('inbox@') or acct.startswith('Actor@'): + continue + bold_reading_filename = \ + base_dir + '/accounts/' + acct + '/.boldReading' + if os.path.isfile(bold_reading_filename): + nickname = acct.split('@')[0] + bold_reading[nickname] = True + return bold_reading + + def get_account_timezone(base_dir: str, nickname: str, domain: str) -> str: """Returns the timezone for the given account """ diff --git a/webapp_confirm.py b/webapp_confirm.py index 7b574ae6f..d0bcedc6d 100644 --- a/webapp_confirm.py +++ b/webapp_confirm.py @@ -24,7 +24,7 @@ from webapp_utils import html_footer from webapp_post import individual_post_as_html -def html_confirm_delete(css_cache: {}, +def html_confirm_delete(server, css_cache: {}, recent_posts_cache: {}, max_recent_posts: int, translate, page_number: int, session, base_dir: str, message_id: str, @@ -71,6 +71,9 @@ def html_confirm_delete(css_cache: {}, mitm = False if os.path.isfile(post_filename.replace('.json', '') + '.mitm'): mitm = True + bold_reading = False + if server.bold_reading.get(nickname): + bold_reading = True delete_post_str += \ individual_post_as_html(signing_priv_key_pem, True, recent_posts_cache, max_recent_posts, @@ -86,7 +89,8 @@ def html_confirm_delete(css_cache: {}, peertube_instances, allow_local_network_access, theme_name, system_language, max_like_count, False, False, False, False, False, False, - cw_lists, lists_enabled, timezone, mitm) + cw_lists, lists_enabled, timezone, mitm, + bold_reading) delete_post_str += '
' delete_post_str += \ '

' + \ diff --git a/webapp_create_post.py b/webapp_create_post.py index 0812ea207..c81ed2cbe 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -212,7 +212,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {}, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, boxName: str, - reply_is_chat: bool) -> str: + reply_is_chat: bool, bold_reading: bool) -> str: """New post screen """ reply_str = '' @@ -286,7 +286,8 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {}, False, False, False, False, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) reply_str = '\n' diff --git a/webapp_frontscreen.py b/webapp_frontscreen.py index 68df1b6de..791dd1dc2 100644 --- a/webapp_frontscreen.py +++ b/webapp_frontscreen.py @@ -37,7 +37,8 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int, theme_name: str, system_language: str, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, - lists_enabled: str) -> str: + lists_enabled: str, + bold_reading: bool) -> str: """Shows posts on the front screen of a news instance These should only be public blog posts from the features timeline which is the blog timeline of the news actor @@ -87,7 +88,8 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int, False, False, False, True, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) if post_str: profile_str += post_str + separator_str ctr += 1 @@ -121,6 +123,7 @@ def html_front_screen(signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str) -> str: """Show the news instance front screen """ + bold_reading = False nickname = profile_json['preferredUsername'] if not nickname: return "" @@ -191,7 +194,8 @@ def html_front_screen(signing_priv_key_pem: str, theme, system_language, max_like_count, signing_priv_key_pem, - cw_lists, lists_enabled) + license_str + cw_lists, lists_enabled, + bold_reading) + license_str # Footer which is only used for system accounts profile_footer_str = ' \n' diff --git a/webapp_likers.py b/webapp_likers.py index 8e79904c7..563b77d54 100644 --- a/webapp_likers.py +++ b/webapp_likers.py @@ -41,6 +41,7 @@ def html_likers_of_post(base_dir: str, nickname: str, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, boxName: str, default_timeline: str, + bold_reading: bool, dict_name: str = 'likes') -> str: """Returns html for a screen showing who liked a post """ @@ -105,7 +106,7 @@ def html_likers_of_post(base_dir: str, nickname: str, False, False, False, False, False, False, cw_lists, lists_enabled, - timezone, mitm) + timezone, mitm, bold_reading) # show likers beneath the post obj = post_json_object diff --git a/webapp_moderation.py b/webapp_moderation.py index 32c654e9c..490772f7f 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -55,7 +55,7 @@ def html_moderation(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the moderation feed as html This is what you see when selecting the "mod" timeline """ @@ -81,7 +81,7 @@ def html_moderation(css_cache: {}, default_timeline: str, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, cw_lists, lists_enabled, - timezone) + timezone, bold_reading) def html_account_info(css_cache: {}, translate: {}, diff --git a/webapp_post.py b/webapp_post.py index 526a2a5ec..bf10079c0 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -58,6 +58,7 @@ from utils import get_domain_from_actor from utils import acct_dir from utils import local_actor_url from utils import is_unlisted_post +from content import bold_reading_string from content import limit_repeated_words from content import replace_emoji_from_tags from content import html_replace_quote_marks @@ -1439,7 +1440,7 @@ def individual_post_as_html(signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, timezone: str, - mitm: bool) -> str: + mitm: bool, bold_reading: bool) -> str: """ Shows a single post as html """ if not post_json_object: @@ -1952,7 +1953,9 @@ def individual_post_as_html(signing_priv_key_pem: str, system_language: '' } + displaying_ciphertext = False if post_json_object['object'].get('cipherText'): + displaying_ciphertext = True post_json_object['object']['content'] = \ e2e_edecrypt_message_from_device(post_json_object['object']) post_json_object['object']['contentMap'][system_language] = \ @@ -1980,6 +1983,9 @@ def individual_post_as_html(signing_priv_key_pem: str, post_json_object['object']['type'], summary_str, content_str) + if bold_reading and not is_patch and not displaying_ciphertext: + content_str = bold_reading_string(content_str) + _log_post_timing(enable_timing_log, post_start_time, '16') if not is_pgp_encrypted(content_str): @@ -2119,7 +2125,8 @@ def html_individual_post(css_cache: {}, theme_name: str, system_language: str, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str, mitm: bool) -> str: + timezone: str, mitm: bool, + bold_reading: bool) -> str: """Show an individual post as html """ original_post_json = post_json_object @@ -2187,7 +2194,8 @@ def html_individual_post(css_cache: {}, allow_local_network_access, theme_name, system_language, max_like_count, False, authorized, False, False, False, False, - cw_lists, lists_enabled, timezone, mitm) + cw_lists, lists_enabled, timezone, mitm, + bold_reading) message_id = remove_id_ending(post_json_object['id']) # show the previous posts @@ -2227,7 +2235,8 @@ def html_individual_post(css_cache: {}, False, authorized, False, False, False, False, cw_lists, lists_enabled, - timezone, mitm) + post_str + timezone, mitm, + bold_reading) + post_str # show the following posts post_filename = locate_post(base_dir, nickname, domain, message_id) @@ -2265,7 +2274,8 @@ def html_individual_post(css_cache: {}, False, authorized, False, False, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) css_filename = base_dir + '/epicyon-profile.css' if os.path.isfile(base_dir + '/epicyon.css'): css_filename = base_dir + '/epicyon.css' @@ -2293,7 +2303,7 @@ def html_post_replies(css_cache: {}, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the replies to an individual post as html """ replies_str = '' @@ -2319,7 +2329,8 @@ def html_post_replies(css_cache: {}, False, False, False, False, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) css_filename = base_dir + '/epicyon-profile.css' if os.path.isfile(base_dir + '/epicyon.css'): @@ -2349,7 +2360,7 @@ def html_emoji_reaction_picker(css_cache: {}, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, box_name: str, page_number: int, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Returns the emoji picker screen """ reacted_to_post_str = \ @@ -2372,7 +2383,8 @@ def html_emoji_reaction_picker(css_cache: {}, theme_name, system_language, max_like_count, False, False, False, False, False, False, - cw_lists, lists_enabled, timezone, False) + cw_lists, lists_enabled, timezone, False, + bold_reading) reactions_filename = base_dir + '/emoji/reactions.json' if not os.path.isfile(reactions_filename): diff --git a/webapp_profile.py b/webapp_profile.py index e5ee588a2..d10777f82 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -75,6 +75,7 @@ from blog import get_blog_address from webapp_post import individual_post_as_html from webapp_timeline import html_individual_share from blocking import get_cw_list_variable +from content import bold_reading_string THEME_FORMATS = '.zip, .gz' @@ -146,7 +147,8 @@ def html_profile_after_search(css_cache: {}, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, timezone: str, - onion_domain: str, i2p_domain: str) -> str: + onion_domain: str, i2p_domain: str, + bold_reading: bool) -> str: """Show a profile page after a search for a fediverse address """ http = False @@ -368,7 +370,8 @@ def html_profile_after_search(css_cache: {}, False, False, False, False, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) i += 1 if i >= 8: break @@ -591,7 +594,7 @@ def html_profile(signing_priv_key_pem: str, max_items_per_page: int, cw_lists: {}, lists_enabled: str, content_license_url: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the profile page as html """ nickname = profile_json['preferredUsername'] @@ -1002,7 +1005,7 @@ def html_profile(signing_priv_key_pem: str, max_like_count, signing_priv_key_pem, cw_lists, lists_enabled, - timezone) + license_str + timezone, bold_reading) + license_str if not is_group: if selected == 'following': profile_str += \ @@ -1076,7 +1079,7 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Shows posts on the profile screen These should only be public posts """ @@ -1125,7 +1128,8 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int, False, False, False, True, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, + bold_reading) if post_str: profile_str += post_str + separator_str ctr += 1 @@ -1993,7 +1997,7 @@ def _html_edit_profile_options(is_admin: bool, notify_likes: str, notify_reactions: str, hide_like_button: str, hide_reaction_button: str, - translate: {}) -> str: + translate: {}, bold_reading: bool) -> str: """option checkboxes section of edit profile screen """ edit_profile_form = '

\n' @@ -2025,6 +2029,9 @@ def _html_edit_profile_options(is_admin: bool, edit_profile_form += \ edit_check_box(translate["Don't show the Reaction button"], 'hideReactionButton', hide_reaction_button) + bold_str = bold_reading_string(translate['Bold reading']) + edit_profile_form += \ + edit_check_box(bold_str, 'boldReading', bold_reading) edit_profile_form += '
\n' return edit_profile_form @@ -2158,7 +2165,8 @@ def _html_edit_profile_top_banner(base_dir: str, return edit_profile_form -def html_edit_profile(css_cache: {}, translate: {}, base_dir: str, path: str, +def html_edit_profile(server, css_cache: {}, translate: {}, + base_dir: str, path: str, domain: str, port: int, http_prefix: str, default_timeline: str, theme: str, peertube_instances: [], @@ -2177,6 +2185,10 @@ def html_edit_profile(css_cache: {}, translate: {}, base_dir: str, path: str, return '' domain_full = get_full_domain(domain, port) + bold_reading = False + if server.bold_reading(nickname): + bold_reading = True + actor_filename = acct_dir(base_dir, nickname, domain) + '.json' if not os.path.isfile(actor_filename): return '' @@ -2346,7 +2358,7 @@ def html_edit_profile(css_cache: {}, translate: {}, base_dir: str, path: str, remove_twitter, notify_likes, notify_reactions, hide_like_button, hide_reaction_button, - translate) + translate, bold_reading) # Contact information edit_profile_form += \ diff --git a/webapp_search.py b/webapp_search.py index b84955068..5d543e733 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -613,7 +613,7 @@ def html_history_search(css_cache: {}, translate: {}, base_dir: str, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show a page containing search results for your post history """ if historysearch.startswith("'"): @@ -701,7 +701,7 @@ def html_history_search(css_cache: {}, translate: {}, base_dir: str, show_individual_post_icons, False, False, False, False, cw_lists, lists_enabled, - timezone, False) + timezone, False, bold_reading) if post_str: history_search_form += separator_str + post_str index += 1 @@ -727,7 +727,7 @@ def html_hashtag_search(css_cache: {}, max_like_count: int, signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show a page containing search results for a hashtag or after selecting a hashtag from the swarm """ @@ -887,7 +887,8 @@ def html_hashtag_search(css_cache: {}, manually_approves_followers, show_public_only, store_to_sache, False, cw_lists, - lists_enabled, timezone, False) + lists_enabled, timezone, False, + bold_reading) if post_str: hashtag_search_form += separator_str + post_str index += 1 diff --git a/webapp_timeline.py b/webapp_timeline.py index 6da01cf05..ccabb2f73 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -455,7 +455,7 @@ def html_timeline(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the timeline as html """ enable_timing_log = False @@ -935,7 +935,8 @@ def html_timeline(css_cache: {}, default_timeline: str, manually_approve_followers, False, True, use_cache_only, cw_lists, lists_enabled, - timezone, mitm) + timezone, mitm, + bold_reading) _log_timeline_timing(enable_timing_log, timeline_start_time, box_name, '12') @@ -1164,7 +1165,7 @@ def html_shares(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the shares timeline as html """ manually_approve_followers = \ @@ -1194,7 +1195,8 @@ def html_shares(css_cache: {}, default_timeline: str, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, + bold_reading) def html_wanted(css_cache: {}, default_timeline: str, @@ -1223,7 +1225,7 @@ def html_wanted(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the wanted timeline as html """ manually_approve_followers = \ @@ -1253,7 +1255,8 @@ def html_wanted(css_cache: {}, default_timeline: str, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, + bold_reading) def html_inbox(css_cache: {}, default_timeline: str, @@ -1283,7 +1286,7 @@ def html_inbox(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the inbox as html """ manually_approve_followers = \ @@ -1313,7 +1316,8 @@ def html_inbox(css_cache: {}, default_timeline: str, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, + bold_reading) def html_bookmarks(css_cache: {}, default_timeline: str, @@ -1343,7 +1347,7 @@ def html_bookmarks(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the bookmarks as html """ manually_approve_followers = \ @@ -1372,7 +1376,8 @@ def html_bookmarks(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, + bold_reading) def html_inbox_dms(css_cache: {}, default_timeline: str, @@ -1402,7 +1407,7 @@ def html_inbox_dms(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the DM timeline as html """ artist = is_artist(base_dir, nickname) @@ -1427,7 +1432,8 @@ def html_inbox_dms(css_cache: {}, default_timeline: str, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, + bold_reading) def html_inbox_replies(css_cache: {}, default_timeline: str, @@ -1457,7 +1463,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the replies timeline as html """ artist = is_artist(base_dir, nickname) @@ -1481,7 +1487,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading) def html_inbox_media(css_cache: {}, default_timeline: str, @@ -1511,7 +1517,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the media timeline as html """ artist = is_artist(base_dir, nickname) @@ -1535,7 +1541,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading) def html_inbox_blogs(css_cache: {}, default_timeline: str, @@ -1565,7 +1571,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the blogs timeline as html """ artist = is_artist(base_dir, nickname) @@ -1589,7 +1595,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading) def html_inbox_features(css_cache: {}, default_timeline: str, @@ -1620,7 +1626,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the features timeline as html """ return html_timeline(css_cache, default_timeline, @@ -1643,7 +1649,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading) def html_inbox_news(css_cache: {}, default_timeline: str, @@ -1673,7 +1679,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the news timeline as html """ return html_timeline(css_cache, default_timeline, @@ -1696,7 +1702,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading) def html_outbox(css_cache: {}, default_timeline: str, @@ -1726,7 +1732,7 @@ def html_outbox(css_cache: {}, default_timeline: str, shared_items_federated_domains: [], signing_priv_key_pem: str, cw_lists: {}, lists_enabled: str, - timezone: str) -> str: + timezone: str, bold_reading: bool) -> str: """Show the Outbox as html """ manually_approve_followers = \ @@ -1752,4 +1758,4 @@ def html_outbox(css_cache: {}, default_timeline: str, allow_local_network_access, text_mode_banner, access_keys, system_language, max_like_count, shared_items_federated_domains, signing_priv_key_pem, - cw_lists, lists_enabled, timezone) + cw_lists, lists_enabled, timezone, bold_reading)