More robust bold reading detection

main
Bob Mottram 2022-03-24 13:53:56 +00:00
parent 15795248d7
commit 4ea1f7e1bd
1 changed files with 8 additions and 6 deletions

View File

@ -3350,7 +3350,7 @@ def _inbox_after_initial(server,
cw_lists: {}, lists_enabled: str,
content_license_url: str,
languages_understood: [],
mitm: bool) -> bool:
mitm: bool, bold_reading: bool) -> bool:
""" Anything which needs to be done after initial checks have passed
"""
# if this is a clearnet instance then replace any onion/i2p
@ -3377,10 +3377,6 @@ def _inbox_after_initial(server,
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,
@ -4807,6 +4803,11 @@ def run_inbox_queue(server,
mitm = False
if queue_json.get('mitm'):
mitm = True
bold_reading = False
bold_reading_filename = \
base_dir + '/accounts/' + handle + '/.boldReading'
if os.path.isfile(bold_reading_filename):
bold_reading = True
_inbox_after_initial(server,
recent_posts_cache,
max_recent_posts,
@ -4838,7 +4839,8 @@ def run_inbox_queue(server,
default_reply_interval_hrs,
cw_lists, lists_enabled,
content_license_url,
languages_understood, mitm)
languages_understood, mitm,
bold_reading)
if debug:
pprint(queue_json['post'])
print('Queue: Queue post accepted')