diff libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py @ 4166:a1f7040b5a15

plugin XEP-0424: message retraction update: - follow specification update (with namespace bump) - retract from history on message reception for group chat - send bridge message
author Goffi <goffi@goffi.org>
date Thu, 30 Nov 2023 13:23:53 +0100
parents 7067b0d73183
children e92c32014024
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py	Tue Nov 28 17:41:49 2023 +0100
+++ b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py	Thu Nov 30 13:23:53 2023 +0100
@@ -167,7 +167,7 @@
         self.ad_hoc = APAdHocService(self)
         self.ap_events = APEvents(self)
         host.trigger.add("message_received", self._message_received_trigger, priority=-1000)
-        host.trigger.add("XEP-0424_retractReceived", self._on_message_retract)
+        host.trigger.add("XEP-0424_retract_received", self._on_message_retract)
         host.trigger.add("XEP-0372_ref_received", self._on_reference_received)
 
         host.bridge.add_method(
@@ -2321,7 +2321,7 @@
         client: SatXMPPEntity,
         message_elt: domish.Element,
         retract_elt: domish.Element,
-        fastened_elts
+        history: History
     ) -> bool:
         if client != self.client:
             return True
@@ -2341,7 +2341,7 @@
         actor_id = await self.get_ap_actor_id_from_account(ap_account)
         inbox = await self.get_ap_inbox_from_id(actor_id, use_shared=False)
         url_actor, ap_item = await self.ap_delete_item(
-            from_jid.userhostJID(), None, fastened_elts.id, public=False
+            from_jid.userhostJID(), None, retract_elt["id"], public=False
         )
         resp = await self.sign_and_post(inbox, url_actor, ap_item)
         return False