# HG changeset patch # User Goffi # Date 1655473834 -7200 # Node ID 2032826cfbcfa3a38c18aec97dc38c02f45e26d1 # Parent adebd8036b68d0e2404780856d6c081d3448db60 component AP gateway typing + remove unused `activity` arg from `newAPDeleteItem` rel 367 diff -r adebd8036b68 -r 2032826cfbcf sat/plugins/plugin_comp_ap_gateway/__init__.py --- a/sat/plugins/plugin_comp_ap_gateway/__init__.py Fri Jun 17 15:50:15 2022 +0200 +++ b/sat/plugins/plugin_comp_ap_gateway/__init__.py Fri Jun 17 15:50:34 2022 +0200 @@ -42,7 +42,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ # 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 -r adebd8036b68 -r 2032826cfbcf sat/plugins/plugin_comp_ap_gateway/http_server.py --- a/sat/plugins/plugin_comp_ap_gateway/http_server.py Fri Jun 17 15:50:15 2022 +0200 +++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py Fri Jun 17 15:50:34 2022 +0200 @@ -252,7 +252,7 @@ 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,