From eb5b89d1135d305ffeb65a4ad0f7f54a9ad08bb8 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 14 Jul 2022 12:55:30 +0200 Subject: [PATCH] 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 --- sat/plugins/plugin_comp_ap_gateway/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sat/plugins/plugin_comp_ap_gateway/__init__.py b/sat/plugins/plugin_comp_ap_gateway/__init__.py index 162c2c60..f4bae96a 100644 --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py @@ -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}")