diff src/plugins/plugin_xep_0050.py @ 1505:5ddc4cf251fa

plugin XEP-0050: pre-fill the target server's field with user's host.
author souliane <souliane@mailoo.org>
date Wed, 02 Sep 2015 12:47:23 +0200
parents 987e74cbb839
children 4eca4f5e21ec
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0050.py	Thu Aug 27 17:59:22 2015 +0200
+++ b/src/plugins/plugin_xep_0050.py	Wed Sep 02 12:47:23 2015 +0200
@@ -401,7 +401,7 @@
         form_ui.addText(_("Please enter target jid"), 'instructions')
         form_ui.changeContainer("pairs")
         form_ui.addLabel("jid")
-        form_ui.addString("jid")
+        jid = form_ui.addString("jid", value=self.host.getClient(profile).jid.host)
         return {'xmlui': form_ui.toXml()}
 
     def _statusCallback(self, command_elt, session_data, action, node, profile):
@@ -431,7 +431,7 @@
             if show not in SHOWS:
                 raise AdHocError(XEP_0050.ERROR.BAD_PAYLOAD)
             if show == "disconnect":
-               self.host.disconnect(profile)
+                self.host.disconnect(profile)
             else:
                 self.host.setPresence(show=show, profile_key=profile)