Improve Announce handling

This commit is contained in:
Thomas Sileo 2022-09-13 07:59:35 +02:00
parent 04da8725ed
commit bd4d5a004a
2 changed files with 13 additions and 1 deletions

View file

@ -38,4 +38,9 @@ async def lookup(db_session: AsyncSession, query: str) -> Actor | RemoteObject:
if ap.as_list(ap_obj["type"])[0] in ap.ACTOR_TYPES:
return RemoteActor(ap_obj)
else:
# Some software return objects wrapped in a Create activity (like
# python-federation)
if ap.as_list(ap_obj["type"])[0] == "Create":
ap_obj = await ap.get_object(ap_obj)
return await RemoteObject.from_raw_object(ap_obj)