From 1f0facb90d051219883d2107bbc1fbfea5b71477 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 May 2025 22:19:26 +0100 Subject: [PATCH] More checks for required actor status fields --- inbox_receive.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inbox_receive.py b/inbox_receive.py index 7270f1a84..948272619 100644 --- a/inbox_receive.py +++ b/inbox_receive.py @@ -1094,13 +1094,27 @@ def receive_actor_status(base_dir: str, person_cache: {}, message_json: {}, """ if message_json['type'] not in ('sm:ActorStatus', 'ActorStatus'): return False + if 'id' not in message_json: + print('DEBUG: receive_actor_status no id ' + str(message_json)) + return True + if not message_json.get('published'): + print('DEBUG: receive_actor_status no published ' + str(message_json)) + return True if 'content' not in message_json: print('DEBUG: receive_actor_status no content ' + str(message_json)) return True + if not isinstance(message_json['published'], str): + print('DEBUG: receive_actor_status published not string ' + + str(message_json)) + return True if not isinstance(message_json['content'], str): print('DEBUG: receive_actor_status content not string ' + str(message_json)) return True + if len(message_json['content']) > 100: + print('DEBUG: receive_actor_status content too long ' + + str(len(message_json['content']))) + return True if not has_actor(message_json, debug): print('DEBUG: receive_actor_status no actor ' + str(message_json))