component AP gateway: we need to use actor and not attributedTo for activities:

`attributedTo` may not be filled, notably when the object is a string URL
This commit is contained in:
Goffi 2022-07-14 12:55:30 +02:00
commit eb5b89d113

View file

@ -970,7 +970,7 @@ class APGateway:
comment_node = comment_data["node"]
await self._p.subscribe(client, comment_service, comment_node)
ap_item = await self.mbdata2APitem(client, mb_data)
url_actor = ap_item["object"]["attributedTo"]
url_actor = ap_item["actor"]
elif item.name == "retract":
url_actor, ap_item = await self.apDeleteItem(
client.jid, node, item["id"]
@ -1690,7 +1690,7 @@ class APGateway:
raise exceptions.DataError("Can't get ActivityPub actor inbox")
item_data = await self.mbdata2APitem(client, mess_data)
url_actor = item_data["object"]["attributedTo"]
url_actor = item_data["actor"]
resp = await self.signAndPost(inbox_url, url_actor, item_data)
if resp.code != 202:
raise exceptions.NetworkError(f"unexpected return code: {resp.code}")