diff --git a/app/boxes.py b/app/boxes.py index 00260e8..1edb24a 100644 --- a/app/boxes.py +++ b/app/boxes.py @@ -90,18 +90,25 @@ async def save_incoming( async def process_incoming( db_session: AsyncSession, - ap_object: dict, + ap_object: dict[str, Any], ) -> bool: actor = await fetch_actor(db_session, ap_object["actor"]) relates_to_inbox_object = None relates_to_outbox_object = None - if ap_object["object"].startswith(BASE_URL): - relates_to_outbox_object = await get_outbox_object( - db_session, - ap_object["object"], - ) + if isinstance(ap_object["object"], dict): + if ap_object["object"]["id"].startswith(BASE_URL): + relates_to_outbox_object = await get_outbox_object( + db_session, + ap_object["object"]["id"], + ) + else: + if ap_object["object"].startswith(BASE_URL): + relates_to_outbox_object = await get_outbox_object( + db_session, + ap_object["object"], + ) def build_object( object,