mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
40221f0efd
commit
a651dc0e98
|
@ -4338,7 +4338,43 @@ def daemon_http_get(self) -> None:
|
|||
getreq_start_time,
|
||||
proxy_type,
|
||||
cookie, self.server.debug,
|
||||
curr_session):
|
||||
curr_session,
|
||||
self.server.access_keys,
|
||||
self.server.key_shortcuts,
|
||||
self.server.city,
|
||||
self.server.account_timezone,
|
||||
self.server.bold_reading,
|
||||
self.server.max_shares_on_profile,
|
||||
self.server.sites_unavailable,
|
||||
self.server.fitness,
|
||||
self.server.signing_priv_key_pem,
|
||||
self.server.rss_icon_at_top,
|
||||
self.server.icons_as_buttons,
|
||||
self.server.default_timeline,
|
||||
self.server.recent_posts_cache,
|
||||
self.server.max_recent_posts,
|
||||
self.server.translate,
|
||||
self.server.project_version,
|
||||
self.server.cached_webfingers,
|
||||
self.server.person_cache,
|
||||
self.server.yt_replace_domain,
|
||||
self.server.twitter_replacement_domain,
|
||||
self.server.show_published_date_only,
|
||||
self.server.newswire,
|
||||
self.server.theme_name,
|
||||
self.server.dormant_months,
|
||||
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.cw_lists,
|
||||
self.server.lists_enabled,
|
||||
self.server.content_license_url,
|
||||
self.server.buy_sites,
|
||||
self.server.no_of_books,
|
||||
self.server.auto_cw_cache):
|
||||
self.server.getreq_busy = False
|
||||
return
|
||||
|
||||
|
|
|
@ -43,7 +43,42 @@ def show_person_profile(self, authorized: bool,
|
|||
getreq_start_time,
|
||||
proxy_type: str, cookie: str,
|
||||
debug: str,
|
||||
curr_session) -> bool:
|
||||
curr_session,
|
||||
access_keys: {},
|
||||
key_shortcuts: {}, city: str,
|
||||
account_timezone: {},
|
||||
bold_reading_nicknames: {},
|
||||
max_shares_on_profile: int,
|
||||
sites_unavailable: [],
|
||||
fitness: {},
|
||||
signing_priv_key_pem: str,
|
||||
rss_icon_at_top: bool,
|
||||
icons_as_buttons: bool,
|
||||
default_timeline: str,
|
||||
recent_posts_cache: {},
|
||||
max_recent_posts: int,
|
||||
translate: {},
|
||||
project_version: str,
|
||||
cached_webfingers: {},
|
||||
person_cache: {},
|
||||
yt_replace_domain: str,
|
||||
twitter_replacement_domain: str,
|
||||
show_published_date_only: bool,
|
||||
newswire: str,
|
||||
theme_name: str,
|
||||
dormant_months: int,
|
||||
peertube_instances: [],
|
||||
allow_local_network_access: bool,
|
||||
text_mode_banner: str,
|
||||
system_language: str,
|
||||
max_like_count: int,
|
||||
shared_items_federated_domains: [],
|
||||
cw_lists: [],
|
||||
lists_enabled: {},
|
||||
content_license_url: str,
|
||||
buy_sites: [],
|
||||
no_of_books: int,
|
||||
auto_cw_cache: {}) -> bool:
|
||||
"""Shows the profile for a person
|
||||
"""
|
||||
# look up a person
|
||||
|
@ -60,73 +95,64 @@ def show_person_profile(self, authorized: bool,
|
|||
http_404(self, 86)
|
||||
return True
|
||||
|
||||
access_keys = self.server.access_keys
|
||||
city = None
|
||||
timezone = None
|
||||
if '/users/' in path:
|
||||
nickname = path.split('/users/')[1]
|
||||
if '/' in nickname:
|
||||
nickname = nickname.split('/')[0]
|
||||
if self.server.key_shortcuts.get(nickname):
|
||||
access_keys = \
|
||||
self.server.key_shortcuts[nickname]
|
||||
if key_shortcuts.get(nickname):
|
||||
access_keys = key_shortcuts[nickname]
|
||||
|
||||
city = get_spoofed_city(self.server.city,
|
||||
base_dir, nickname, domain)
|
||||
if self.server.account_timezone.get(nickname):
|
||||
timezone = \
|
||||
self.server.account_timezone.get(nickname)
|
||||
city = get_spoofed_city(city, base_dir, nickname, domain)
|
||||
if account_timezone.get(nickname):
|
||||
timezone = account_timezone.get(nickname)
|
||||
bold_reading = False
|
||||
if self.server.bold_reading.get(nickname):
|
||||
if bold_reading_nicknames.get(nickname):
|
||||
bold_reading = True
|
||||
max_shares_on_profile = \
|
||||
self.server.max_shares_on_profile
|
||||
sites_unavailable = \
|
||||
self.server.sites_unavailable
|
||||
msg = \
|
||||
html_profile(self.server.signing_priv_key_pem,
|
||||
self.server.rss_icon_at_top,
|
||||
self.server.icons_as_buttons,
|
||||
self.server.default_timeline,
|
||||
self.server.recent_posts_cache,
|
||||
self.server.max_recent_posts,
|
||||
self.server.translate,
|
||||
self.server.project_version,
|
||||
html_profile(signing_priv_key_pem,
|
||||
rss_icon_at_top,
|
||||
icons_as_buttons,
|
||||
default_timeline,
|
||||
recent_posts_cache,
|
||||
max_recent_posts,
|
||||
translate,
|
||||
project_version,
|
||||
base_dir, http_prefix, authorized,
|
||||
actor_json, 'posts', curr_session,
|
||||
self.server.cached_webfingers,
|
||||
self.server.person_cache,
|
||||
self.server.yt_replace_domain,
|
||||
self.server.twitter_replacement_domain,
|
||||
self.server.show_published_date_only,
|
||||
self.server.newswire,
|
||||
self.server.theme_name,
|
||||
self.server.dormant_months,
|
||||
self.server.peertube_instances,
|
||||
self.server.allow_local_network_access,
|
||||
self.server.text_mode_banner,
|
||||
cached_webfingers,
|
||||
person_cache,
|
||||
yt_replace_domain,
|
||||
twitter_replacement_domain,
|
||||
show_published_date_only,
|
||||
newswire,
|
||||
theme_name,
|
||||
dormant_months,
|
||||
peertube_instances,
|
||||
allow_local_network_access,
|
||||
text_mode_banner,
|
||||
debug,
|
||||
access_keys, city,
|
||||
self.server.system_language,
|
||||
self.server.max_like_count,
|
||||
self.server.shared_items_federated_domains,
|
||||
system_language,
|
||||
max_like_count,
|
||||
shared_items_federated_domains,
|
||||
None, None, None,
|
||||
self.server.cw_lists,
|
||||
self.server.lists_enabled,
|
||||
self.server.content_license_url,
|
||||
cw_lists,
|
||||
lists_enabled,
|
||||
content_license_url,
|
||||
timezone, bold_reading,
|
||||
self.server.buy_sites,
|
||||
buy_sites,
|
||||
None,
|
||||
max_shares_on_profile,
|
||||
sites_unavailable,
|
||||
self.server.no_of_books,
|
||||
self.server.auto_cw_cache).encode('utf-8')
|
||||
no_of_books,
|
||||
auto_cw_cache).encode('utf-8')
|
||||
msglen = len(msg)
|
||||
set_headers(self, 'text/html', msglen,
|
||||
cookie, calling_domain, False)
|
||||
write2(self, msg)
|
||||
fitness_performance(getreq_start_time,
|
||||
self.server.fitness,
|
||||
fitness_performance(getreq_start_time, fitness,
|
||||
'_GET', '_show_person_profile',
|
||||
debug)
|
||||
if debug:
|
||||
|
@ -154,8 +180,7 @@ def show_person_profile(self, authorized: bool,
|
|||
set_headers(self, 'application/activity+json', msglen,
|
||||
cookie, calling_domain, False)
|
||||
write2(self, msg)
|
||||
fitness_performance(getreq_start_time,
|
||||
self.server.fitness,
|
||||
fitness_performance(getreq_start_time, fitness,
|
||||
'_GET', '_show_person_profile json',
|
||||
debug)
|
||||
if debug:
|
||||
|
|
Loading…
Reference in New Issue