mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
9441207510
commit
03e9b87df9
|
@ -881,6 +881,356 @@ def _person_options_unfollow(self, options_confirm_params: str,
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_dm(self, options_confirm_params: str,
|
||||||
|
debug: bool, options_actor: str,
|
||||||
|
path: str, key_shortcuts: {},
|
||||||
|
base_dir: str, bold_reading_nicknames: {},
|
||||||
|
chooser_nickname: str, http_prefix: str,
|
||||||
|
domain_full: str, person_cache: {},
|
||||||
|
system_language: str,
|
||||||
|
default_post_language: {},
|
||||||
|
translate: {}, page_number: int,
|
||||||
|
domain: str, default_timeline: str,
|
||||||
|
newswire: str, theme_name: str,
|
||||||
|
recent_posts_cache: {},
|
||||||
|
max_recent_posts: int,
|
||||||
|
curr_session,
|
||||||
|
cached_webfingers: {},
|
||||||
|
port: int, project_version: str,
|
||||||
|
yt_replace_domain: str,
|
||||||
|
twitter_replacement_domain: str,
|
||||||
|
show_published_date_only: bool,
|
||||||
|
peertube_instances: [],
|
||||||
|
allow_local_network_access: bool,
|
||||||
|
max_like_count: int,
|
||||||
|
signing_priv_key_pem: str,
|
||||||
|
cw_lists: {},
|
||||||
|
lists_enabled: {},
|
||||||
|
dogwhistles: {},
|
||||||
|
min_images_for_accounts: {},
|
||||||
|
buy_sites: [],
|
||||||
|
auto_cw_cache: {},
|
||||||
|
cookie: str, calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, DM button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitDM=' in options_confirm_params:
|
||||||
|
if debug:
|
||||||
|
print('Sending DM to ' + options_actor)
|
||||||
|
report_path = path.replace('/personoptions', '') + '/newdm'
|
||||||
|
|
||||||
|
if '/users/' in path:
|
||||||
|
nickname = path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
if key_shortcuts.get(nickname):
|
||||||
|
access_keys = key_shortcuts[nickname]
|
||||||
|
|
||||||
|
custom_submit_text = get_config_param(base_dir, 'customSubmitText')
|
||||||
|
conversation_id = None
|
||||||
|
reply_is_chat = False
|
||||||
|
|
||||||
|
bold_reading = False
|
||||||
|
if bold_reading_nicknames.get(chooser_nickname):
|
||||||
|
bold_reading = True
|
||||||
|
|
||||||
|
languages_understood = \
|
||||||
|
get_understood_languages(base_dir,
|
||||||
|
http_prefix,
|
||||||
|
chooser_nickname,
|
||||||
|
domain_full,
|
||||||
|
person_cache)
|
||||||
|
|
||||||
|
default_post_language2 = system_language
|
||||||
|
if default_post_language.get(nickname):
|
||||||
|
default_post_language2 = default_post_language[nickname]
|
||||||
|
default_buy_site = ''
|
||||||
|
msg = \
|
||||||
|
html_new_post({}, False, translate,
|
||||||
|
base_dir,
|
||||||
|
http_prefix,
|
||||||
|
report_path, None,
|
||||||
|
[options_actor], None, None,
|
||||||
|
page_number, '',
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
domain_full,
|
||||||
|
default_timeline,
|
||||||
|
newswire,
|
||||||
|
theme_name,
|
||||||
|
True, access_keys,
|
||||||
|
custom_submit_text,
|
||||||
|
conversation_id,
|
||||||
|
recent_posts_cache,
|
||||||
|
max_recent_posts,
|
||||||
|
curr_session,
|
||||||
|
cached_webfingers,
|
||||||
|
person_cache,
|
||||||
|
port,
|
||||||
|
None,
|
||||||
|
project_version,
|
||||||
|
yt_replace_domain,
|
||||||
|
twitter_replacement_domain,
|
||||||
|
show_published_date_only,
|
||||||
|
peertube_instances,
|
||||||
|
allow_local_network_access,
|
||||||
|
system_language,
|
||||||
|
languages_understood,
|
||||||
|
max_like_count,
|
||||||
|
signing_priv_key_pem,
|
||||||
|
cw_lists,
|
||||||
|
lists_enabled,
|
||||||
|
default_timeline,
|
||||||
|
reply_is_chat,
|
||||||
|
bold_reading,
|
||||||
|
dogwhistles,
|
||||||
|
min_images_for_accounts,
|
||||||
|
None, None, default_post_language2,
|
||||||
|
buy_sites,
|
||||||
|
default_buy_site,
|
||||||
|
auto_cw_cache)
|
||||||
|
if msg:
|
||||||
|
msg = msg.encode('utf-8')
|
||||||
|
msglen = len(msg)
|
||||||
|
set_headers(self, 'text/html', msglen,
|
||||||
|
cookie, calling_domain, False)
|
||||||
|
write2(self, msg)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_info(self, options_confirm_params: str,
|
||||||
|
base_dir: str, chooser_nickname: str,
|
||||||
|
debug: bool, options_actor: str,
|
||||||
|
translate: {}, http_prefix: str,
|
||||||
|
domain: str, system_language: str,
|
||||||
|
signing_priv_key_pem: str,
|
||||||
|
block_federated: [],
|
||||||
|
cookie: str, calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, Info button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitPersonInfo=' in options_confirm_params:
|
||||||
|
if is_moderator(base_dir, chooser_nickname):
|
||||||
|
if debug:
|
||||||
|
print('Showing info for ' + options_actor)
|
||||||
|
msg = \
|
||||||
|
html_account_info(translate,
|
||||||
|
base_dir,
|
||||||
|
http_prefix,
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
options_actor,
|
||||||
|
debug,
|
||||||
|
system_language,
|
||||||
|
signing_priv_key_pem,
|
||||||
|
None,
|
||||||
|
block_federated)
|
||||||
|
if msg:
|
||||||
|
msg = msg.encode('utf-8')
|
||||||
|
msglen = len(msg)
|
||||||
|
set_headers(self, 'text/html', msglen,
|
||||||
|
cookie, calling_domain, False)
|
||||||
|
write2(self, msg)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
http_404(self, 11)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_snooze(self, options_confirm_params: str,
|
||||||
|
path: str, http_prefix: str,
|
||||||
|
domain_full: str, debug: bool,
|
||||||
|
options_actor: str, base_dir: str,
|
||||||
|
domain: str, calling_domain: str,
|
||||||
|
onion_domain: str, i2p_domain: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int,
|
||||||
|
cookie: str) -> bool:
|
||||||
|
"""Person options screen, snooze button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitSnooze=' in options_confirm_params:
|
||||||
|
users_path = path.split('/personoptions')[0]
|
||||||
|
this_actor = http_prefix + '://' + domain_full + users_path
|
||||||
|
if debug:
|
||||||
|
print('Snoozing ' + options_actor + ' ' + this_actor)
|
||||||
|
if '/users/' in this_actor:
|
||||||
|
nickname = this_actor.split('/users/')[1]
|
||||||
|
person_snooze(base_dir, nickname,
|
||||||
|
domain, options_actor)
|
||||||
|
if calling_domain.endswith('.onion') and onion_domain:
|
||||||
|
this_actor = 'http://' + onion_domain + users_path
|
||||||
|
elif (calling_domain.endswith('.i2p') and i2p_domain):
|
||||||
|
this_actor = 'http://' + i2p_domain + users_path
|
||||||
|
actor_path_str = \
|
||||||
|
this_actor + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, actor_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_unsnooze(self, options_confirm_params: str,
|
||||||
|
path: str, http_prefix: str,
|
||||||
|
domain_full: str, debug: bool,
|
||||||
|
options_actor: str,
|
||||||
|
base_dir: str, domain: str,
|
||||||
|
calling_domain: str,
|
||||||
|
onion_domain: str, i2p_domain: str,
|
||||||
|
default_timeline: str,
|
||||||
|
page_number: int, cookie: str) -> bool:
|
||||||
|
"""Person options screen, unsnooze button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitUnsnooze=' in options_confirm_params:
|
||||||
|
users_path = path.split('/personoptions')[0]
|
||||||
|
this_actor = http_prefix + '://' + domain_full + users_path
|
||||||
|
if debug:
|
||||||
|
print('Unsnoozing ' + options_actor + ' ' + this_actor)
|
||||||
|
if '/users/' in this_actor:
|
||||||
|
nickname = this_actor.split('/users/')[1]
|
||||||
|
person_unsnooze(base_dir, nickname,
|
||||||
|
domain, options_actor)
|
||||||
|
if calling_domain.endswith('.onion') and onion_domain:
|
||||||
|
this_actor = 'http://' + onion_domain + users_path
|
||||||
|
elif (calling_domain.endswith('.i2p') and i2p_domain):
|
||||||
|
this_actor = 'http://' + i2p_domain + users_path
|
||||||
|
actor_path_str = \
|
||||||
|
this_actor + '/' + default_timeline + \
|
||||||
|
'?page=' + str(page_number)
|
||||||
|
redirect_headers(self, actor_path_str, cookie,
|
||||||
|
calling_domain, 303)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _person_options_report(self, options_confirm_params: str,
|
||||||
|
debug: bool, path: str,
|
||||||
|
options_actor: str, key_shortcuts: {},
|
||||||
|
base_dir: str, bold_reading_nicknames: {},
|
||||||
|
chooser_nickname: str,
|
||||||
|
http_prefix: str, domain_full: str,
|
||||||
|
person_cache: {}, system_language: str,
|
||||||
|
default_post_language: {},
|
||||||
|
translate: {}, post_url: str,
|
||||||
|
page_number: int,
|
||||||
|
domain: str, default_timeline: str,
|
||||||
|
newswire: {},
|
||||||
|
theme_name: str,
|
||||||
|
recent_posts_cache: {},
|
||||||
|
max_recent_posts: int,
|
||||||
|
curr_session,
|
||||||
|
cached_webfingers: {}, port: int,
|
||||||
|
project_version: str,
|
||||||
|
yt_replace_domain: str,
|
||||||
|
twitter_replacement_domain: str,
|
||||||
|
show_published_date_only: bool,
|
||||||
|
peertube_instances: [],
|
||||||
|
allow_local_network_access: bool,
|
||||||
|
max_like_count: int,
|
||||||
|
signing_priv_key_pem: str,
|
||||||
|
cw_lists: {},
|
||||||
|
lists_enabled: {},
|
||||||
|
dogwhistles: {},
|
||||||
|
min_images_for_accounts: {},
|
||||||
|
buy_sites: [],
|
||||||
|
auto_cw_cache: {},
|
||||||
|
cookie: str, calling_domain: str) -> bool:
|
||||||
|
"""Person options screen, report button
|
||||||
|
See html_person_options
|
||||||
|
"""
|
||||||
|
if '&submitReport=' in options_confirm_params:
|
||||||
|
if debug:
|
||||||
|
print('Reporting ' + options_actor)
|
||||||
|
report_path = \
|
||||||
|
path.replace('/personoptions', '') + '/newreport'
|
||||||
|
|
||||||
|
if '/users/' in path:
|
||||||
|
nickname = path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
if key_shortcuts.get(nickname):
|
||||||
|
access_keys = key_shortcuts[nickname]
|
||||||
|
|
||||||
|
custom_submit_text = get_config_param(base_dir, 'customSubmitText')
|
||||||
|
conversation_id = None
|
||||||
|
reply_is_chat = False
|
||||||
|
|
||||||
|
bold_reading = False
|
||||||
|
if bold_reading_nicknames.get(chooser_nickname):
|
||||||
|
bold_reading = True
|
||||||
|
|
||||||
|
languages_understood = \
|
||||||
|
get_understood_languages(base_dir,
|
||||||
|
http_prefix,
|
||||||
|
chooser_nickname,
|
||||||
|
domain_full,
|
||||||
|
person_cache)
|
||||||
|
|
||||||
|
default_post_language2 = system_language
|
||||||
|
if default_post_language.get(nickname):
|
||||||
|
default_post_language2 = default_post_language[nickname]
|
||||||
|
default_buy_site = ''
|
||||||
|
msg = \
|
||||||
|
html_new_post({}, False, translate,
|
||||||
|
base_dir,
|
||||||
|
http_prefix,
|
||||||
|
report_path, None, [],
|
||||||
|
None, post_url, page_number, '',
|
||||||
|
chooser_nickname,
|
||||||
|
domain,
|
||||||
|
domain_full,
|
||||||
|
default_timeline,
|
||||||
|
newswire,
|
||||||
|
theme_name,
|
||||||
|
True, access_keys,
|
||||||
|
custom_submit_text,
|
||||||
|
conversation_id,
|
||||||
|
recent_posts_cache,
|
||||||
|
max_recent_posts,
|
||||||
|
curr_session,
|
||||||
|
cached_webfingers,
|
||||||
|
person_cache,
|
||||||
|
port,
|
||||||
|
None,
|
||||||
|
project_version,
|
||||||
|
yt_replace_domain,
|
||||||
|
twitter_replacement_domain,
|
||||||
|
show_published_date_only,
|
||||||
|
peertube_instances,
|
||||||
|
allow_local_network_access,
|
||||||
|
system_language,
|
||||||
|
languages_understood,
|
||||||
|
max_like_count,
|
||||||
|
signing_priv_key_pem,
|
||||||
|
cw_lists,
|
||||||
|
lists_enabled,
|
||||||
|
default_timeline,
|
||||||
|
reply_is_chat,
|
||||||
|
bold_reading,
|
||||||
|
dogwhistles,
|
||||||
|
min_images_for_accounts,
|
||||||
|
None, None, default_post_language2,
|
||||||
|
buy_sites,
|
||||||
|
default_buy_site,
|
||||||
|
auto_cw_cache)
|
||||||
|
if msg:
|
||||||
|
msg = msg.encode('utf-8')
|
||||||
|
msglen = len(msg)
|
||||||
|
set_headers(self, 'text/html', msglen,
|
||||||
|
cookie, calling_domain, False)
|
||||||
|
write2(self, msg)
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def person_options2(self, path: str,
|
def person_options2(self, path: str,
|
||||||
calling_domain: str, cookie: str,
|
calling_domain: str, cookie: str,
|
||||||
base_dir: str, http_prefix: str,
|
base_dir: str, http_prefix: str,
|
||||||
|
@ -1225,251 +1575,102 @@ def person_options2(self, path: str,
|
||||||
cookie, calling_domain):
|
cookie, calling_domain):
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, DM button
|
if _person_options_dm(self, options_confirm_params,
|
||||||
# See html_person_options
|
debug, options_actor,
|
||||||
if '&submitDM=' in options_confirm_params:
|
path, key_shortcuts,
|
||||||
if debug:
|
base_dir, bold_reading_nicknames,
|
||||||
print('Sending DM to ' + options_actor)
|
chooser_nickname, http_prefix,
|
||||||
report_path = path.replace('/personoptions', '') + '/newdm'
|
domain_full, person_cache,
|
||||||
|
system_language,
|
||||||
if '/users/' in path:
|
default_post_language,
|
||||||
nickname = path.split('/users/')[1]
|
translate, page_number,
|
||||||
if '/' in nickname:
|
domain, default_timeline,
|
||||||
nickname = nickname.split('/')[0]
|
newswire, theme_name,
|
||||||
if key_shortcuts.get(nickname):
|
|
||||||
access_keys = key_shortcuts[nickname]
|
|
||||||
|
|
||||||
custom_submit_text = get_config_param(base_dir, 'customSubmitText')
|
|
||||||
conversation_id = None
|
|
||||||
reply_is_chat = False
|
|
||||||
|
|
||||||
bold_reading = False
|
|
||||||
if bold_reading_nicknames.get(chooser_nickname):
|
|
||||||
bold_reading = True
|
|
||||||
|
|
||||||
languages_understood = \
|
|
||||||
get_understood_languages(base_dir,
|
|
||||||
http_prefix,
|
|
||||||
chooser_nickname,
|
|
||||||
domain_full,
|
|
||||||
person_cache)
|
|
||||||
|
|
||||||
default_post_language2 = system_language
|
|
||||||
if default_post_language.get(nickname):
|
|
||||||
default_post_language2 = default_post_language[nickname]
|
|
||||||
default_buy_site = ''
|
|
||||||
msg = \
|
|
||||||
html_new_post({}, False, translate,
|
|
||||||
base_dir,
|
|
||||||
http_prefix,
|
|
||||||
report_path, None,
|
|
||||||
[options_actor], None, None,
|
|
||||||
page_number, '',
|
|
||||||
chooser_nickname,
|
|
||||||
domain,
|
|
||||||
domain_full,
|
|
||||||
default_timeline,
|
|
||||||
newswire,
|
|
||||||
theme_name,
|
|
||||||
True, access_keys,
|
|
||||||
custom_submit_text,
|
|
||||||
conversation_id,
|
|
||||||
recent_posts_cache,
|
recent_posts_cache,
|
||||||
max_recent_posts,
|
max_recent_posts,
|
||||||
curr_session,
|
curr_session,
|
||||||
cached_webfingers,
|
cached_webfingers,
|
||||||
person_cache,
|
port, project_version,
|
||||||
port,
|
|
||||||
None,
|
|
||||||
project_version,
|
|
||||||
yt_replace_domain,
|
yt_replace_domain,
|
||||||
twitter_replacement_domain,
|
twitter_replacement_domain,
|
||||||
show_published_date_only,
|
show_published_date_only,
|
||||||
peertube_instances,
|
peertube_instances,
|
||||||
allow_local_network_access,
|
allow_local_network_access,
|
||||||
system_language,
|
|
||||||
languages_understood,
|
|
||||||
max_like_count,
|
max_like_count,
|
||||||
signing_priv_key_pem,
|
signing_priv_key_pem,
|
||||||
cw_lists,
|
cw_lists,
|
||||||
lists_enabled,
|
lists_enabled,
|
||||||
default_timeline,
|
|
||||||
reply_is_chat,
|
|
||||||
bold_reading,
|
|
||||||
dogwhistles,
|
dogwhistles,
|
||||||
min_images_for_accounts,
|
min_images_for_accounts,
|
||||||
None, None, default_post_language2,
|
|
||||||
buy_sites,
|
buy_sites,
|
||||||
default_buy_site,
|
auto_cw_cache,
|
||||||
auto_cw_cache)
|
cookie, calling_domain):
|
||||||
if msg:
|
|
||||||
msg = msg.encode('utf-8')
|
|
||||||
msglen = len(msg)
|
|
||||||
set_headers(self, 'text/html', msglen,
|
|
||||||
cookie, calling_domain, False)
|
|
||||||
write2(self, msg)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, Info button
|
if _person_options_info(self, options_confirm_params,
|
||||||
# See html_person_options
|
base_dir, chooser_nickname,
|
||||||
if '&submitPersonInfo=' in options_confirm_params:
|
debug, options_actor,
|
||||||
if is_moderator(base_dir, chooser_nickname):
|
translate, http_prefix,
|
||||||
if debug:
|
domain, system_language,
|
||||||
print('Showing info for ' + options_actor)
|
signing_priv_key_pem,
|
||||||
msg = \
|
block_federated,
|
||||||
html_account_info(translate,
|
cookie, calling_domain):
|
||||||
base_dir,
|
|
||||||
http_prefix,
|
|
||||||
chooser_nickname,
|
|
||||||
domain,
|
|
||||||
options_actor,
|
|
||||||
debug,
|
|
||||||
system_language,
|
|
||||||
signing_priv_key_pem,
|
|
||||||
None,
|
|
||||||
block_federated)
|
|
||||||
if msg:
|
|
||||||
msg = msg.encode('utf-8')
|
|
||||||
msglen = len(msg)
|
|
||||||
set_headers(self, 'text/html', msglen,
|
|
||||||
cookie, calling_domain, False)
|
|
||||||
write2(self, msg)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
|
||||||
http_404(self, 11)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# person options screen, snooze button
|
if _person_options_snooze(self, options_confirm_params,
|
||||||
# See html_person_options
|
path, http_prefix,
|
||||||
if '&submitSnooze=' in options_confirm_params:
|
domain_full, debug,
|
||||||
users_path = path.split('/personoptions')[0]
|
options_actor, base_dir,
|
||||||
this_actor = http_prefix + '://' + domain_full + users_path
|
domain, calling_domain,
|
||||||
if debug:
|
onion_domain, i2p_domain,
|
||||||
print('Snoozing ' + options_actor + ' ' + this_actor)
|
default_timeline,
|
||||||
if '/users/' in this_actor:
|
page_number,
|
||||||
nickname = this_actor.split('/users/')[1]
|
cookie):
|
||||||
person_snooze(base_dir, nickname,
|
return
|
||||||
domain, options_actor)
|
|
||||||
if calling_domain.endswith('.onion') and onion_domain:
|
|
||||||
this_actor = 'http://' + onion_domain + users_path
|
|
||||||
elif (calling_domain.endswith('.i2p') and i2p_domain):
|
|
||||||
this_actor = 'http://' + i2p_domain + users_path
|
|
||||||
actor_path_str = \
|
|
||||||
this_actor + '/' + default_timeline + \
|
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, actor_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
|
||||||
|
|
||||||
# person options screen, unsnooze button
|
if _person_options_unsnooze(self, options_confirm_params,
|
||||||
# See html_person_options
|
path, http_prefix,
|
||||||
if '&submitUnsnooze=' in options_confirm_params:
|
domain_full, debug,
|
||||||
users_path = path.split('/personoptions')[0]
|
options_actor,
|
||||||
this_actor = http_prefix + '://' + domain_full + users_path
|
base_dir, domain,
|
||||||
if debug:
|
calling_domain,
|
||||||
print('Unsnoozing ' + options_actor + ' ' + this_actor)
|
onion_domain, i2p_domain,
|
||||||
if '/users/' in this_actor:
|
default_timeline,
|
||||||
nickname = this_actor.split('/users/')[1]
|
page_number, cookie):
|
||||||
person_unsnooze(base_dir, nickname,
|
return
|
||||||
domain, options_actor)
|
|
||||||
if calling_domain.endswith('.onion') and onion_domain:
|
|
||||||
this_actor = 'http://' + onion_domain + users_path
|
|
||||||
elif (calling_domain.endswith('.i2p') and i2p_domain):
|
|
||||||
this_actor = 'http://' + i2p_domain + users_path
|
|
||||||
actor_path_str = \
|
|
||||||
this_actor + '/' + default_timeline + \
|
|
||||||
'?page=' + str(page_number)
|
|
||||||
redirect_headers(self, actor_path_str, cookie,
|
|
||||||
calling_domain, 303)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
|
||||||
|
|
||||||
# person options screen, report button
|
if _person_options_report(self, options_confirm_params,
|
||||||
# See html_person_options
|
debug, path,
|
||||||
if '&submitReport=' in options_confirm_params:
|
options_actor, key_shortcuts,
|
||||||
if debug:
|
base_dir, bold_reading_nicknames,
|
||||||
print('Reporting ' + options_actor)
|
chooser_nickname,
|
||||||
report_path = \
|
http_prefix, domain_full,
|
||||||
path.replace('/personoptions', '') + '/newreport'
|
person_cache, system_language,
|
||||||
|
default_post_language,
|
||||||
if '/users/' in path:
|
translate, post_url,
|
||||||
nickname = path.split('/users/')[1]
|
page_number,
|
||||||
if '/' in nickname:
|
domain, default_timeline,
|
||||||
nickname = nickname.split('/')[0]
|
newswire,
|
||||||
if key_shortcuts.get(nickname):
|
theme_name,
|
||||||
access_keys = key_shortcuts[nickname]
|
recent_posts_cache,
|
||||||
|
max_recent_posts,
|
||||||
custom_submit_text = get_config_param(base_dir, 'customSubmitText')
|
curr_session,
|
||||||
conversation_id = None
|
cached_webfingers, port,
|
||||||
reply_is_chat = False
|
project_version,
|
||||||
|
yt_replace_domain,
|
||||||
bold_reading = False
|
twitter_replacement_domain,
|
||||||
if bold_reading_nicknames.get(chooser_nickname):
|
show_published_date_only,
|
||||||
bold_reading = True
|
peertube_instances,
|
||||||
|
allow_local_network_access,
|
||||||
languages_understood = \
|
max_like_count,
|
||||||
get_understood_languages(base_dir,
|
signing_priv_key_pem,
|
||||||
http_prefix,
|
cw_lists,
|
||||||
chooser_nickname,
|
lists_enabled,
|
||||||
domain_full,
|
dogwhistles,
|
||||||
person_cache)
|
min_images_for_accounts,
|
||||||
|
buy_sites,
|
||||||
default_post_language2 = system_language
|
auto_cw_cache,
|
||||||
if default_post_language.get(nickname):
|
cookie, calling_domain):
|
||||||
default_post_language2 = default_post_language[nickname]
|
|
||||||
default_buy_site = ''
|
|
||||||
msg = \
|
|
||||||
html_new_post({}, False, translate,
|
|
||||||
base_dir,
|
|
||||||
http_prefix,
|
|
||||||
report_path, None, [],
|
|
||||||
None, post_url, page_number, '',
|
|
||||||
chooser_nickname,
|
|
||||||
domain,
|
|
||||||
domain_full,
|
|
||||||
default_timeline,
|
|
||||||
newswire,
|
|
||||||
theme_name,
|
|
||||||
True, access_keys,
|
|
||||||
custom_submit_text,
|
|
||||||
conversation_id,
|
|
||||||
recent_posts_cache,
|
|
||||||
max_recent_posts,
|
|
||||||
curr_session,
|
|
||||||
cached_webfingers,
|
|
||||||
person_cache,
|
|
||||||
port,
|
|
||||||
None,
|
|
||||||
project_version,
|
|
||||||
yt_replace_domain,
|
|
||||||
twitter_replacement_domain,
|
|
||||||
show_published_date_only,
|
|
||||||
peertube_instances,
|
|
||||||
allow_local_network_access,
|
|
||||||
system_language,
|
|
||||||
languages_understood,
|
|
||||||
max_like_count,
|
|
||||||
signing_priv_key_pem,
|
|
||||||
cw_lists,
|
|
||||||
lists_enabled,
|
|
||||||
default_timeline,
|
|
||||||
reply_is_chat,
|
|
||||||
bold_reading,
|
|
||||||
dogwhistles,
|
|
||||||
min_images_for_accounts,
|
|
||||||
None, None, default_post_language2,
|
|
||||||
buy_sites,
|
|
||||||
default_buy_site,
|
|
||||||
auto_cw_cache)
|
|
||||||
if msg:
|
|
||||||
msg = msg.encode('utf-8')
|
|
||||||
msglen = len(msg)
|
|
||||||
set_headers(self, 'text/html', msglen,
|
|
||||||
cookie, calling_domain, False)
|
|
||||||
write2(self, msg)
|
|
||||||
self.server.postreq_busy = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# redirect back from person options screen
|
# redirect back from person options screen
|
||||||
|
|
Loading…
Reference in New Issue