diff libervia/backend/plugins/plugin_xep_0353.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 0da563780ffc
children e11b13418ba6
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0353.py	Sat Dec 09 19:19:26 2023 +0100
+++ b/libervia/backend/plugins/plugin_xep_0353.py	Sat Dec 09 19:20:13 2023 +0100
@@ -39,7 +39,7 @@
     C.PI_NAME: "Jingle Message Initiation",
     C.PI_IMPORT_NAME: "XEP-0353",
     C.PI_TYPE: "XEP",
-    C.PI_MODES: [C.PLUG_MODE_CLIENT],
+    C.PI_MODES: C.PLUG_MODE_BOTH,
     C.PI_PROTOCOLS: ["XEP-0353"],
     C.PI_DEPENDENCIES: ["XEP-0166", "XEP-0334"],
     C.PI_MAIN: "XEP_0353",
@@ -66,15 +66,17 @@
         host.register_namespace("jingle-message", NS_JINGLE_MESSAGE)
         self._j = host.plugins["XEP-0166"]
         self._h = host.plugins["XEP-0334"]
-        host.trigger.add(
+        host.trigger.add_with_check(
             "XEP-0166_initiate_elt_built",
+            self,
             self._on_initiate_trigger,
             # this plugin set the resource, we want it to happen first to other trigger
             # can get the full peer JID
             priority=host.trigger.MAX_PRIORITY,
         )
-        host.trigger.add(
+        host.trigger.add_with_check(
             "XEP-0166_terminate",
+            self,
             self._terminate_trigger,
             priority=host.trigger.MAX_PRIORITY,
         )