Add more debug

main
Bob Mottram 2025-05-15 20:52:10 +01:00
parent 763d7c7410
commit 5df3f03396
2 changed files with 23 additions and 15 deletions

View File

@ -1858,15 +1858,15 @@ def _inbox_after_initial(server, inbox_start_time,
handle_name = handle.split('@')[0]
#if receive_actor_status(base_dir, person_cache, message_json,
# debug):
# if debug:
# print('DEBUG: ActorStatus from ' + actor)
# fitness_performance(inbox_start_time, server.fitness,
# 'INBOX', '_receive_actor_status',
# debug)
# inbox_start_time = time.time()
# return False
if receive_actor_status(base_dir, person_cache, message_json,
debug):
if debug:
print('DEBUG: ActorStatus from ' + actor)
fitness_performance(inbox_start_time, server.fitness,
'INBOX', '_receive_actor_status',
debug)
inbox_start_time = time.time()
return False
if receive_like(recent_posts_cache,
session, handle,

View File

@ -1095,22 +1095,30 @@ def receive_actor_status(base_dir: str, person_cache: {}, message_json: {},
if message_json['type'] not in ('sm:ActorStatus', 'ActorStatus'):
return False
if 'content' in message_json:
return False
print('DEBUG: receive_actor_status no content ' + str(message_json))
return True
if not isinstance(message_json['content'], str):
return False
print('DEBUG: receive_actor_status content not string ' +
str(message_json))
return True
if not has_actor(message_json, debug):
return False
print('DEBUG: receive_actor_status no actor ' +
str(message_json))
return True
actor_url = get_actor_from_post(message_json)
if not actor_url:
return False
print('DEBUG: receive_actor_status no actor url ' +
str(message_json))
return True
if not has_users_path(actor_url):
if debug:
print('DEBUG: "users" or "profile" missing from actor status in ' +
str(message_json))
return False
return True
actor_json = get_person_from_cache(base_dir, actor_url, person_cache)
if not actor_json:
return False
print('DEBUG: receive_actor_status actor not found ' + actor_url)
return True
actor_json['sm:status'] = message_json
allow_write_to_file = True
store_person_in_cache(base_dir, actor_url,