diff libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py @ 4183:6784d07b99c8

plugin XEP-053, component AP gateway: use the new `trigger.add_with_check` method
author Goffi <goffi@goffi.org>
date Sat, 09 Dec 2023 19:20:13 +0100
parents e92c32014024
children 49019947cc76
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py	Sat Dec 09 19:19:26 2023 +0100
+++ b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py	Sat Dec 09 19:20:13 2023 +0100
@@ -166,9 +166,22 @@
         self.pubsub_service = APPubsubService(self)
         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_retract_received", self._on_message_retract)
-        host.trigger.add("XEP-0372_ref_received", self._on_reference_received)
+        host.trigger.add_with_check(
+            "message_received",
+            self,
+            self._message_received_trigger,
+            priority=-1000
+        )
+        host.trigger.add_with_check(
+            "XEP-0424_retract_received",
+            self,
+            self._on_message_retract
+        )
+        host.trigger.add_with_check(
+            "XEP-0372_ref_received",
+            self,
+            self._on_reference_received
+        )
 
         host.bridge.add_method(
             "ap_send",