mirror of https://gitlab.com/bashrc2/epicyon
Bold reading accessibility feature
parent
f55f7a258f
commit
7f1e23c013
37
content.py
37
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 '<p>' in text:
|
||||
text = text.replace('</p>', '\n').replace('<p>', '')
|
||||
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 += \
|
||||
'<b>' + wrd[:initial_chars] + '</b>' + \
|
||||
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 += '<p>' + new_parag + '</p>'
|
||||
else:
|
||||
if not add_paragraph_markup:
|
||||
new_text += new_parag
|
||||
else:
|
||||
new_text += '<p>' + new_parag + '</p>'
|
||||
|
||||
return new_text
|
||||
|
|
260
daemon.py
260
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
|
||||
|
|
87
inbox.py
87
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) *
|
||||
|
|
|
@ -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):
|
||||
|
|
35
tests.py
35
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 = \
|
||||
"<b>Th</b>is <b>i</b>s a <b>te</b>st <b>o</b>f " + \
|
||||
"<b>embold</b>ening."
|
||||
if text_bold != expected:
|
||||
print(text_bold)
|
||||
assert text_bold == expected
|
||||
|
||||
text = "<p>This is a test of emboldening with paragraph.<p>"
|
||||
text_bold = bold_reading_string(text)
|
||||
expected = \
|
||||
"<p><b>Th</b>is <b>i</b>s a <b>te</b>st <b>o</b>f " + \
|
||||
"<b>embol</b>dening <b>wi</b>th <b>parag</b>raph.</p>"
|
||||
if text_bold != expected:
|
||||
print(text_bold)
|
||||
assert text_bold == expected
|
||||
|
||||
text = \
|
||||
"<p>This is a test of emboldening</p>" + \
|
||||
"<p>With more than one paragraph.<p>"
|
||||
text_bold = bold_reading_string(text)
|
||||
expected = \
|
||||
"<p><b>Th</b>is <b>i</b>s a <b>te</b>st <b>o</b>f " + \
|
||||
"<b>embol</b>dening</p><p><b>Wi</b>th <b>mo</b>re " + \
|
||||
"<b>th</b>an <b>o</b>ne <b>parag</b>raph.</p>"
|
||||
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()
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "يسجل",
|
||||
"Web Bots Allowed": "مسموح روبوتات الويب",
|
||||
"Known Search Bots": "روبوتات بحث الويب المعروفة",
|
||||
"mitm": "يمكن قراءة الرسالة أو تعديلها من قبل طرف ثالث"
|
||||
"mitm": "يمكن قراءة الرسالة أو تعديلها من قبل طرف ثالث",
|
||||
"Bold reading": "قراءة جريئة"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "रजिस्टर करें",
|
||||
"Web Bots Allowed": "वेब बॉट्स की अनुमति है",
|
||||
"Known Search Bots": "ज्ञात वेब खोज बॉट्स",
|
||||
"mitm": "संदेश किसी तीसरे पक्ष द्वारा पढ़ा या संशोधित किया जा सकता था"
|
||||
"mitm": "संदेश किसी तीसरे पक्ष द्वारा पढ़ा या संशोधित किया जा सकता था",
|
||||
"Bold reading": "बोल्ड रीडिंग"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "登録",
|
||||
"Web Bots Allowed": "許可されたWebボット",
|
||||
"Known Search Bots": "既知のWeb検索ボット",
|
||||
"mitm": "メッセージが第三者によって読み取られたり変更されたりした可能性があります"
|
||||
"mitm": "メッセージが第三者によって読み取られたり変更されたりした可能性があります",
|
||||
"Bold reading": "大胆な読書"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "등록",
|
||||
"Web Bots Allowed": "웹 봇 허용",
|
||||
"Known Search Bots": "알려진 웹 검색 봇",
|
||||
"mitm": "제3자가 메시지를 읽거나 수정했을 수 있습니다."
|
||||
"mitm": "제3자가 메시지를 읽거나 수정했을 수 있습니다.",
|
||||
"Bold reading": "굵은 글씨"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "регистр",
|
||||
"Web Bots Allowed": "Веб-боты разрешены",
|
||||
"Known Search Bots": "Известные боты веб-поиска",
|
||||
"mitm": "Сообщение могло быть прочитано или изменено третьим лицом"
|
||||
"mitm": "Сообщение могло быть прочитано или изменено третьим лицом",
|
||||
"Bold reading": "Смелое чтение"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "Реєстрація",
|
||||
"Web Bots Allowed": "Веб-боти дозволені",
|
||||
"Known Search Bots": "Відомі пошукові роботи в Інтернеті",
|
||||
"mitm": "Повідомлення могло бути прочитане або змінене третьою стороною"
|
||||
"mitm": "Повідомлення могло бути прочитане або змінене третьою стороною",
|
||||
"Bold reading": "Сміливе читання"
|
||||
}
|
||||
|
|
|
@ -518,5 +518,6 @@
|
|||
"Register": "登记",
|
||||
"Web Bots Allowed": "允许网络机器人",
|
||||
"Known Search Bots": "已知的网络搜索机器人",
|
||||
"mitm": "消息可能已被第三方阅读或修改"
|
||||
"mitm": "消息可能已被第三方阅读或修改",
|
||||
"Bold reading": "大胆阅读"
|
||||
}
|
||||
|
|
18
utils.py
18
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
|
||||
"""
|
||||
|
|
|
@ -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 += '<center>'
|
||||
delete_post_str += \
|
||||
' <p class="followText">' + \
|
||||
|
|
|
@ -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 = '<input type="hidden" ' + \
|
||||
'name="replyTo" value="' + inReplyTo + '">\n'
|
||||
|
|
|
@ -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 = ' </td>\n'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: {},
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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 = ' <div class="container">\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 += ' </div>\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 += \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue