mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
94b3dbff78
commit
04f29054c6
|
@ -5184,7 +5184,49 @@ def daemon_http_get(self) -> None:
|
||||||
getreq_start_time,
|
getreq_start_time,
|
||||||
cookie, self.server.debug,
|
cookie, self.server.debug,
|
||||||
curr_session, ua_str,
|
curr_session, ua_str,
|
||||||
proxy_type, MAX_POSTS_IN_FEED):
|
proxy_type, MAX_POSTS_IN_FEED,
|
||||||
|
self.server.recent_posts_cache,
|
||||||
|
self.server.newswire_votes_threshold,
|
||||||
|
self.server.positive_voting,
|
||||||
|
self.server.voting_time_mins,
|
||||||
|
self.server.full_width_tl_button_header,
|
||||||
|
self.server.access_keys,
|
||||||
|
self.server.key_shortcuts,
|
||||||
|
self.server.account_timezone,
|
||||||
|
self.server.bold_reading,
|
||||||
|
self.server.reverse_sequence,
|
||||||
|
self.server.default_timeline,
|
||||||
|
self.server.max_recent_posts,
|
||||||
|
self.server.translate,
|
||||||
|
self.server.cached_webfingers,
|
||||||
|
self.server.person_cache,
|
||||||
|
self.server.allow_deletion,
|
||||||
|
self.server.project_version,
|
||||||
|
self.server.yt_replace_domain,
|
||||||
|
self.server.twitter_replacement_domain,
|
||||||
|
self.server.show_published_date_only,
|
||||||
|
self.server.newswire,
|
||||||
|
self.server.show_publish_as_icon,
|
||||||
|
self.server.icons_as_buttons,
|
||||||
|
self.server.rss_icon_at_top,
|
||||||
|
self.server.publish_button_at_top,
|
||||||
|
self.server.theme_name,
|
||||||
|
self.server.peertube_instances,
|
||||||
|
self.server.allow_local_network_access,
|
||||||
|
self.server.text_mode_banner,
|
||||||
|
self.server.system_language,
|
||||||
|
self.server.max_like_count,
|
||||||
|
self.server.shared_items_federated_domains,
|
||||||
|
self.server.signing_priv_key_pem,
|
||||||
|
self.server.cw_lists,
|
||||||
|
self.server.lists_enabled,
|
||||||
|
self.server.dogwhistles,
|
||||||
|
self.server.min_images_for_accounts,
|
||||||
|
self.server.buy_sites,
|
||||||
|
self.server.auto_cw_cache,
|
||||||
|
self.server.fitness,
|
||||||
|
self.server.onion_domain,
|
||||||
|
self.server.i2p_domain):
|
||||||
self.server.getreq_busy = False
|
self.server.getreq_busy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -1351,18 +1351,60 @@ def show_outbox_timeline(self, authorized: bool,
|
||||||
cookie: str, debug: str,
|
cookie: str, debug: str,
|
||||||
curr_session, ua_str: str,
|
curr_session, ua_str: str,
|
||||||
proxy_type: str,
|
proxy_type: str,
|
||||||
max_posts_in_feed: int) -> bool:
|
max_posts_in_feed: int,
|
||||||
|
recent_posts_cache: {},
|
||||||
|
newswire_votes_threshold: int,
|
||||||
|
positive_voting: bool,
|
||||||
|
voting_time_mins: int,
|
||||||
|
full_width_tl_button_header: bool,
|
||||||
|
access_keys: {},
|
||||||
|
key_shortcuts: {},
|
||||||
|
account_timezone: {},
|
||||||
|
bold_reading_nicknames: {},
|
||||||
|
reverse_sequence_nicknames: [],
|
||||||
|
default_timeline: str,
|
||||||
|
max_recent_posts: int,
|
||||||
|
translate: {},
|
||||||
|
cached_webfingers: {},
|
||||||
|
person_cache: {},
|
||||||
|
allow_deletion: bool,
|
||||||
|
project_version: str,
|
||||||
|
yt_replace_domain: str,
|
||||||
|
twitter_replacement_domain: str,
|
||||||
|
show_published_date_only: bool,
|
||||||
|
newswire: {},
|
||||||
|
show_publish_as_icon: bool,
|
||||||
|
icons_as_buttons: bool,
|
||||||
|
rss_icon_at_top: bool,
|
||||||
|
publish_button_at_top: bool,
|
||||||
|
theme_name: str,
|
||||||
|
peertube_instances: [],
|
||||||
|
allow_local_network_access: bool,
|
||||||
|
text_mode_banner: str,
|
||||||
|
system_language: str,
|
||||||
|
max_like_count: int,
|
||||||
|
shared_items_federated_domains: [],
|
||||||
|
signing_priv_key_pem: str,
|
||||||
|
cw_lists: {},
|
||||||
|
lists_enabled: {},
|
||||||
|
dogwhistles: {},
|
||||||
|
min_images_for_accounts: [],
|
||||||
|
buy_sites: {},
|
||||||
|
auto_cw_cache: {},
|
||||||
|
fitness: {},
|
||||||
|
onion_domain: str,
|
||||||
|
i2p_domain: str) -> bool:
|
||||||
"""Shows the outbox timeline
|
"""Shows the outbox timeline
|
||||||
"""
|
"""
|
||||||
# get outbox feed for a person
|
# get outbox feed for a person
|
||||||
outbox_feed = \
|
outbox_feed = \
|
||||||
person_box_json(self.server.recent_posts_cache,
|
person_box_json(recent_posts_cache,
|
||||||
base_dir, domain, port, path,
|
base_dir, domain, port, path,
|
||||||
http_prefix, max_posts_in_feed, 'outbox',
|
http_prefix, max_posts_in_feed, 'outbox',
|
||||||
authorized,
|
authorized,
|
||||||
self.server.newswire_votes_threshold,
|
newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
positive_voting,
|
||||||
self.server.voting_time_mins)
|
voting_time_mins)
|
||||||
if outbox_feed:
|
if outbox_feed:
|
||||||
nickname = \
|
nickname = \
|
||||||
path.replace('/users/', '').replace('/outbox', '')
|
path.replace('/users/', '').replace('/outbox', '')
|
||||||
|
@ -1385,96 +1427,88 @@ def show_outbox_timeline(self, authorized: bool,
|
||||||
# if a page wasn't specified then show the first one
|
# if a page wasn't specified then show the first one
|
||||||
page_str = '?page=' + str(page_number)
|
page_str = '?page=' + str(page_number)
|
||||||
outbox_feed = \
|
outbox_feed = \
|
||||||
person_box_json(self.server.recent_posts_cache,
|
person_box_json(recent_posts_cache,
|
||||||
base_dir, domain, port,
|
base_dir, domain, port,
|
||||||
path + page_str,
|
path + page_str,
|
||||||
http_prefix,
|
http_prefix,
|
||||||
max_posts_in_feed, 'outbox',
|
max_posts_in_feed, 'outbox',
|
||||||
authorized,
|
authorized,
|
||||||
self.server.newswire_votes_threshold,
|
newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
positive_voting,
|
||||||
self.server.voting_time_mins)
|
voting_time_mins)
|
||||||
else:
|
else:
|
||||||
page_number = 1
|
page_number = 1
|
||||||
|
|
||||||
if request_http(self.headers, debug):
|
if request_http(self.headers, debug):
|
||||||
full_width_tl_button_header = \
|
|
||||||
self.server.full_width_tl_button_header
|
|
||||||
minimal_nick = is_minimal(base_dir, domain, nickname)
|
minimal_nick = is_minimal(base_dir, domain, nickname)
|
||||||
|
|
||||||
access_keys = self.server.access_keys
|
if key_shortcuts.get(nickname):
|
||||||
if self.server.key_shortcuts.get(nickname):
|
access_keys = key_shortcuts[nickname]
|
||||||
access_keys = \
|
|
||||||
self.server.key_shortcuts[nickname]
|
|
||||||
|
|
||||||
timezone = None
|
timezone = None
|
||||||
if self.server.account_timezone.get(nickname):
|
if account_timezone.get(nickname):
|
||||||
timezone = \
|
timezone = account_timezone.get(nickname)
|
||||||
self.server.account_timezone.get(nickname)
|
|
||||||
bold_reading = False
|
bold_reading = False
|
||||||
if self.server.bold_reading.get(nickname):
|
if bold_reading_nicknames.get(nickname):
|
||||||
bold_reading = True
|
bold_reading = True
|
||||||
reverse_sequence = False
|
reverse_sequence = False
|
||||||
if nickname in self.server.reverse_sequence:
|
if nickname in reverse_sequence_nicknames:
|
||||||
reverse_sequence = True
|
reverse_sequence = True
|
||||||
msg = \
|
msg = \
|
||||||
html_outbox(self.server.default_timeline,
|
html_outbox(default_timeline,
|
||||||
self.server.recent_posts_cache,
|
recent_posts_cache,
|
||||||
self.server.max_recent_posts,
|
max_recent_posts,
|
||||||
self.server.translate,
|
translate,
|
||||||
page_number, max_posts_in_feed,
|
page_number, max_posts_in_feed,
|
||||||
curr_session,
|
curr_session,
|
||||||
base_dir,
|
base_dir,
|
||||||
self.server.cached_webfingers,
|
cached_webfingers,
|
||||||
self.server.person_cache,
|
person_cache,
|
||||||
nickname, domain, port,
|
nickname, domain, port,
|
||||||
outbox_feed,
|
outbox_feed,
|
||||||
self.server.allow_deletion,
|
allow_deletion,
|
||||||
http_prefix,
|
http_prefix,
|
||||||
self.server.project_version,
|
project_version,
|
||||||
minimal_nick,
|
minimal_nick,
|
||||||
self.server.yt_replace_domain,
|
yt_replace_domain,
|
||||||
self.server.twitter_replacement_domain,
|
twitter_replacement_domain,
|
||||||
self.server.show_published_date_only,
|
show_published_date_only,
|
||||||
self.server.newswire,
|
newswire,
|
||||||
self.server.positive_voting,
|
positive_voting,
|
||||||
self.server.show_publish_as_icon,
|
show_publish_as_icon,
|
||||||
full_width_tl_button_header,
|
full_width_tl_button_header,
|
||||||
self.server.icons_as_buttons,
|
icons_as_buttons,
|
||||||
self.server.rss_icon_at_top,
|
rss_icon_at_top,
|
||||||
self.server.publish_button_at_top,
|
publish_button_at_top,
|
||||||
authorized,
|
authorized,
|
||||||
self.server.theme_name,
|
theme_name,
|
||||||
self.server.peertube_instances,
|
peertube_instances,
|
||||||
self.server.allow_local_network_access,
|
allow_local_network_access,
|
||||||
self.server.text_mode_banner,
|
text_mode_banner,
|
||||||
access_keys,
|
access_keys,
|
||||||
self.server.system_language,
|
system_language,
|
||||||
self.server.max_like_count,
|
max_like_count,
|
||||||
self.server.shared_items_federated_domains,
|
shared_items_federated_domains,
|
||||||
self.server.signing_priv_key_pem,
|
signing_priv_key_pem,
|
||||||
self.server.cw_lists,
|
cw_lists,
|
||||||
self.server.lists_enabled,
|
lists_enabled,
|
||||||
timezone, bold_reading,
|
timezone, bold_reading,
|
||||||
self.server.dogwhistles, ua_str,
|
dogwhistles, ua_str,
|
||||||
self.server.min_images_for_accounts,
|
min_images_for_accounts,
|
||||||
reverse_sequence,
|
reverse_sequence,
|
||||||
self.server.buy_sites,
|
buy_sites,
|
||||||
self.server.auto_cw_cache)
|
auto_cw_cache)
|
||||||
msg = msg.encode('utf-8')
|
msg = msg.encode('utf-8')
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
set_headers(self, 'text/html', msglen,
|
set_headers(self, 'text/html', msglen,
|
||||||
cookie, calling_domain, False)
|
cookie, calling_domain, False)
|
||||||
write2(self, msg)
|
write2(self, msg)
|
||||||
fitness_performance(getreq_start_time,
|
fitness_performance(getreq_start_time, fitness,
|
||||||
self.server.fitness,
|
|
||||||
'_GET', '_show_outbox_timeline',
|
'_GET', '_show_outbox_timeline',
|
||||||
debug)
|
debug)
|
||||||
else:
|
else:
|
||||||
if secure_mode(curr_session, proxy_type, False,
|
if secure_mode(curr_session, proxy_type, False,
|
||||||
self.server, self.headers, self.path):
|
self.server, self.headers, self.path):
|
||||||
onion_domain = self.server.onion_domain
|
|
||||||
i2p_domain = self.server.i2p_domain
|
|
||||||
msg_str = json.dumps(outbox_feed,
|
msg_str = json.dumps(outbox_feed,
|
||||||
ensure_ascii=False)
|
ensure_ascii=False)
|
||||||
msg_str = convert_domains(calling_domain,
|
msg_str = convert_domains(calling_domain,
|
||||||
|
@ -1491,8 +1525,7 @@ def show_outbox_timeline(self, authorized: bool,
|
||||||
set_headers(self, protocol_str, msglen,
|
set_headers(self, protocol_str, msglen,
|
||||||
None, calling_domain, False)
|
None, calling_domain, False)
|
||||||
write2(self, msg)
|
write2(self, msg)
|
||||||
fitness_performance(getreq_start_time,
|
fitness_performance(getreq_start_time, fitness,
|
||||||
self.server.fitness,
|
|
||||||
'_GET', '_show_outbox_timeline json',
|
'_GET', '_show_outbox_timeline json',
|
||||||
debug)
|
debug)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue