diff --git a/sat/plugins/plugin_comp_ap_gateway/__init__.py b/sat/plugins/plugin_comp_ap_gateway/__init__.py index 26fc8e51..5bf0c9c0 100644 --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py @@ -42,7 +42,7 @@ from twisted.internet import defer, reactor, threads from twisted.web import http from twisted.words.protocols.jabber import error, jid from twisted.words.xish import domish -from wokkel import rsm +from wokkel import rsm, pubsub from sat.core import exceptions from sat.core.constants import Const as C @@ -232,7 +232,11 @@ class APGateway: client.sendHistory = True await self.init(client) - async def _itemsReceived(self, client, itemsEvent): + async def _itemsReceived( + self, + client: SatXMPPEntity, + itemsEvent: pubsub.ItemsEvent + ) -> None: """Callback called when pubsub items are received if the items are adressed to a JID corresponding to an AP actor, they are @@ -930,6 +934,10 @@ class APGateway: async def getAPActorIdFromAccount(self, account: str) -> str: """Retrieve account ID from it's handle using WebFinger + Don't use this method to get local actor id from a local account derivated for + JID: in this case, the actor ID is retrieve with + ``self.buildAPURL(TYPE_ACTOR, ap_account)`` + @param account: AP handle (user@domain.tld) @return: Actor ID (which is an URL) """ @@ -1898,7 +1906,6 @@ class APGateway: client: SatXMPPEntity, destinee: Optional[jid.JID], node: str, - activity: dict, item: dict, ) -> None: """Analyse, cache and send notification for received AP item @@ -1931,7 +1938,7 @@ class APGateway: # it's a direct message if history.source_jid != client.jid: log.warning( - f"retractation received from an entity ''{client.jid}) which is " + f"retraction received from an entity ''{client.jid}) which is " f"not the original sender of the message ({history.source_jid}), " "hack attemps?" ) diff --git a/sat/plugins/plugin_comp_ap_gateway/http_server.py b/sat/plugins/plugin_comp_ap_gateway/http_server.py index daf03b0e..ea1c1ee5 100644 --- a/sat/plugins/plugin_comp_ap_gateway/http_server.py +++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py @@ -252,7 +252,7 @@ class HTTPAPGServer(web_resource.Resource): client = await self.apg.getVirtualClient(signing_actor) objects = await self.apg.apGetList(data, "object") for obj in objects: - await self.apg.newAPDeleteItem(client, account_jid, node, data, obj) + await self.apg.newAPDeleteItem(client, account_jid, node, obj) async def handleCreateActivity( self,