diff libervia/backend/plugins/plugin_xep_0045.py @ 4083:2ea567afc0cf

plugin XEP-0045: fix calls to `join`
author Goffi <goffi@goffi.org>
date Wed, 07 Jun 2023 22:26:17 +0200
parents 4b842c1fb686
children d861ad696797
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0045.py	Wed Jun 07 22:25:49 2023 +0200
+++ b/libervia/backend/plugins/plugin_xep_0045.py	Wed Jun 07 22:26:17 2023 +0200
@@ -269,7 +269,9 @@
     def _ui_room_join_cb(self, data, profile):
         room_jid = jid.JID(data['index'])
         client = self.host.get_client(profile)
-        self.join(client, room_jid)
+        defer.ensureDeferred(
+            self.join(client, room_jid)
+        )
         return {}
 
     def _password_ui_cb(self, data, client, room_jid, nick):
@@ -539,9 +541,12 @@
             if not room_jid.user:
                 room_jid.user, room_jid.host = room_jid.host, muc_service
         else:
-            room_jid = self.get_unique_name(profile_key=client.profile)
+            room_jid = self.get_unique_name(client)
         # TODO: error management + signal in bridge
-        d = self.join(client, room_jid, nick, options or None)
+        d = defer.ensureDeferred(
+            self.join(client, room_jid, nick, options or None)
+        )
+
         d.addCallback(lambda room: [False] + self._get_room_joined_args(room, client.profile))
         d.addErrback(self._join_eb, client)
         return d
@@ -697,7 +702,9 @@
                 muc_service = client.muc_service or ""
                 nick = client.jid.user
             room_jid = self.text_cmds.get_room_jid(room_raw, muc_service)
-            self.join(client, room_jid, nick, {})
+            defer.ensureDeferred(
+                self.join(client, room_jid, nick, {})
+            )
 
         return False