diff sat/plugins/plugin_xep_0045.py @ 3002:6acaa8244220

plugin 0249: fixed invitation handling + some improvments: - properly retrieve payload by namespace - now use a trigger instead of observer, so the message workflow is stopped if an invitation is found - namespace is registered fix 241
author Goffi <goffi@goffi.org>
date Sun, 14 Jul 2019 11:23:25 +0200
parents 94708a7d3ecf
children c8c68a3b0a79
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0045.py	Sun Jul 14 11:23:23 2019 +0200
+++ b/sat/plugins/plugin_xep_0045.py	Sun Jul 14 11:23:25 2019 +0200
@@ -482,13 +482,19 @@
             options = {}
         if room_jid in client._muc_client.joined_rooms:
             room = client._muc_client.joined_rooms[room_jid]
-            log.info(_(u'{profile} is already in room {room_jid}').format(profile=client.profile, room_jid = room_jid.userhost()))
+            log.info(_(u'{profile} is already in room {room_jid}').format(
+                profile=client.profile, room_jid = room_jid.userhost()))
             return defer.fail(AlreadyJoined(room))
-        log.info(_(u"[{profile}] is joining room {room} with nick {nick}").format(profile=client.profile, room=room_jid.userhost(), nick=nick))
+        log.info(_(u"[{profile}] is joining room {room} with nick {nick}").format(
+            profile=client.profile, room=room_jid.userhost(), nick=nick))
 
         password = options.get("password")
 
-        return client._muc_client.join(room_jid, nick, password).addCallbacks(self._joinCb, self._joinEb, (client, room_jid, nick), errbackArgs=(client, room_jid, nick, password))
+        d = client._muc_client.join(room_jid, nick, password)
+        d.addCallbacks(self._joinCb, self._joinEb,
+                       (client, room_jid, nick),
+                       errbackArgs=(client, room_jid, nick, password))
+        return d
 
     def _nick(self, room_jid_s, nick, profile_key=C.PROF_KEY_NONE):
         client = self.host.getClient(profile_key)