Rename function

main
bashrc 2026-04-08 19:30:01 +01:00
parent fff2b1e9b7
commit 8dc7811cba
1 changed files with 76 additions and 76 deletions

152
inbox.py
View File

@ -1851,39 +1851,39 @@ def _former_representations_to_edits(base_dir: str,
return True return True
def _inbox_after_initial(server, inbox_start_time, def _inbox_third_stage(server, inbox_start_time,
recent_posts_cache: {}, max_recent_posts: int, recent_posts_cache: {}, max_recent_posts: int,
session, session_onion, session_i2p, session, session_onion, session_i2p,
session_yggdrasil, session_yggdrasil,
key_id: str, handle: str, message_json: {}, key_id: str, handle: str, message_json: {},
base_dir: str, http_prefix: str, send_threads: [], base_dir: str, http_prefix: str, send_threads: [],
post_log: [], cached_webfingers: {}, person_cache: {}, post_log: [], cached_webfingers: {}, person_cache: {},
domain: str, onion_domain: str, i2p_domain: str, domain: str, onion_domain: str, i2p_domain: str,
yggdrasil_domain: str, yggdrasil_domain: str,
port: int, federation_list: [], debug: bool, port: int, federation_list: [], debug: bool,
queue_filename: str, destination_filename: str, queue_filename: str, destination_filename: str,
max_replies: int, allow_deletion: bool, max_replies: int, allow_deletion: bool,
max_mentions: int, max_emoji: int, translate: {}, max_mentions: int, max_emoji: int, translate: {},
unit_test: bool, unit_test: bool,
yt_replace_domain: str, yt_replace_domain: str,
twitter_replacement_domain: str, twitter_replacement_domain: str,
show_published_date_only: bool, show_published_date_only: bool,
allow_local_network_access: bool, allow_local_network_access: bool,
peertube_instances: [], peertube_instances: [],
last_bounce_message: [], last_bounce_message: [],
theme_name: str, system_language: str, theme_name: str, system_language: str,
max_like_count: int, max_like_count: int,
signing_priv_key_pem: str, signing_priv_key_pem: str,
default_reply_interval_hrs: int, default_reply_interval_hrs: int,
cw_lists: {}, lists_enabled: str, cw_lists: {}, lists_enabled: str,
dm_license_url: str, dm_license_url: str,
languages_understood: [], languages_understood: [],
mitm: bool, bold_reading: bool, mitm: bool, bold_reading: bool,
dogwhistles: {}, dogwhistles: {},
max_hashtags: int, buy_sites: {}, max_hashtags: int, buy_sites: {},
sites_unavailable: [], sites_unavailable: [],
mitm_servers: [], mitm_servers: [],
instance_software: {}) -> bool: instance_software: {}) -> bool:
""" Anything which needs to be done after initial checks have passed """ Anything which needs to be done after initial checks have passed
""" """
# if this is a clearnet instance then replace any onion/i2p # if this is a clearnet instance then replace any onion/i2p
@ -1897,7 +1897,7 @@ def _inbox_after_initial(server, inbox_start_time,
message_json = json.loads(message_str) message_json = json.loads(message_str)
except json.decoder.JSONDecodeError as ex: except json.decoder.JSONDecodeError as ex:
print('EX: json decode error ' + str(ex) + print('EX: json decode error ' + str(ex) +
' from _inbox_after_initial onion ' + ' from _inbox_third_stage onion ' +
str(message_str)) str(message_str))
inbox_start_time = time.time() inbox_start_time = time.time()
return False return False
@ -1908,7 +1908,7 @@ def _inbox_after_initial(server, inbox_start_time,
message_json = json.loads(message_str) message_json = json.loads(message_str)
except json.decoder.JSONDecodeError as ex: except json.decoder.JSONDecodeError as ex:
print('EX: json decode error ' + str(ex) + print('EX: json decode error ' + str(ex) +
' from _inbox_after_initial i2p ' + ' from _inbox_third_stage i2p ' +
str(message_str)) str(message_str))
inbox_start_time = time.time() inbox_start_time = time.time()
return False return False
@ -1919,7 +1919,7 @@ def _inbox_after_initial(server, inbox_start_time,
message_json = json.loads(message_str) message_json = json.loads(message_str)
except json.decoder.JSONDecodeError as ex: except json.decoder.JSONDecodeError as ex:
print('EX: json decode error ' + str(ex) + print('EX: json decode error ' + str(ex) +
' from _inbox_after_initial yggdrasil ' + ' from _inbox_third_stage yggdrasil ' +
str(message_str)) str(message_str))
inbox_start_time = time.time() inbox_start_time = time.time()
return False return False
@ -2531,7 +2531,7 @@ def _inbox_after_initial(server, inbox_start_time,
encoding='utf-8') as fp_mitm: encoding='utf-8') as fp_mitm:
fp_mitm.write('\n') fp_mitm.write('\n')
except OSError: except OSError:
print('EX: _inbox_after_initial unable to write ' + print('EX: _inbox_third_stage unable to write ' +
destination_filename_mitm) destination_filename_mitm)
_low_frequency_post_notification(base_dir, http_prefix, _low_frequency_post_notification(base_dir, http_prefix,
@ -2552,7 +2552,7 @@ def _inbox_after_initial(server, inbox_start_time,
encoding='utf-8') as fp_mute: encoding='utf-8') as fp_mute:
fp_mute.write('\n') fp_mute.write('\n')
except OSError: except OSError:
print('EX: _inbox_after_initial unable to write 2 ' + print('EX: _inbox_third_stage unable to write 2 ' +
destination_filename_muted) destination_filename_muted)
# is this an edit of a previous post? # is this an edit of a previous post?
@ -3617,44 +3617,44 @@ def _inbox_second_stage(curr_post_json: {},
acct_handle_dir(base_dir, handle) + '/.boldReading' acct_handle_dir(base_dir, handle) + '/.boldReading'
if os.path.isfile(bold_reading_filename): if os.path.isfile(bold_reading_filename):
bold_reading = True bold_reading = True
_inbox_after_initial(server, inbox_start_time, _inbox_third_stage(server, inbox_start_time,
recent_posts_cache, recent_posts_cache,
max_recent_posts, max_recent_posts,
session, session_onion, session_i2p, session, session_onion, session_i2p,
session_yggdrasil, session_yggdrasil,
key_id, handle, key_id, handle,
curr_post_json, curr_post_json,
base_dir, http_prefix, base_dir, http_prefix,
send_threads, post_log, send_threads, post_log,
cached_webfingers, cached_webfingers,
person_cache, domain, person_cache, domain,
onion_domain, i2p_domain, onion_domain, i2p_domain,
yggdrasil_domain, yggdrasil_domain,
port, federation_list, port, federation_list,
debug, debug,
queue_filename, destination, queue_filename, destination,
max_replies, allow_deletion, max_replies, allow_deletion,
max_mentions, max_emoji, max_mentions, max_emoji,
translate, unit_test, translate, unit_test,
yt_replace_domain, yt_replace_domain,
twitter_replacement_domain, twitter_replacement_domain,
show_published_date_only, show_published_date_only,
allow_local_network_access, allow_local_network_access,
peertube_instances, peertube_instances,
last_bounce_message, last_bounce_message,
theme_name, system_language, theme_name, system_language,
max_like_count, max_like_count,
signing_priv_key_pem, signing_priv_key_pem,
default_reply_interval_hrs, default_reply_interval_hrs,
cw_lists, lists_enabled, cw_lists, lists_enabled,
dm_license_url, dm_license_url,
languages_understood, mitm, languages_understood, mitm,
bold_reading, dogwhistles, bold_reading, dogwhistles,
max_hashtags, server.buy_sites, max_hashtags, server.buy_sites,
server.sites_unavailable, server.sites_unavailable,
server.mitm_servers, server.mitm_servers,
server.instance_software) server.instance_software)
fitness_performance(inbox_start_time, server.fitness, fitness_performance(inbox_start_time, server.fitness,
'INBOX', 'handle_after_initial', 'INBOX', 'handle_after_initial',
debug) debug)
inbox_start_time = time.time() inbox_start_time = time.time()