[fix] undo follow

This commit is contained in:
SouthFox 2023-04-27 11:17:20 +08:00
parent 50f1595dcd
commit 4e6e9d803e

View file

@ -90,13 +90,20 @@ async def save_incoming(
async def process_incoming( async def process_incoming(
db_session: AsyncSession, db_session: AsyncSession,
ap_object: dict, ap_object: dict[str, Any],
) -> bool: ) -> bool:
actor = await fetch_actor(db_session, ap_object["actor"]) actor = await fetch_actor(db_session, ap_object["actor"])
relates_to_inbox_object = None relates_to_inbox_object = None
relates_to_outbox_object = None relates_to_outbox_object = None
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): if ap_object["object"].startswith(BASE_URL):
relates_to_outbox_object = await get_outbox_object( relates_to_outbox_object = await get_outbox_object(
db_session, db_session,