Pārlūkot izejas kodu

If no resource exists, add one which mentions converse.js

updates #123
JC Brand 11 gadi atpakaļ
vecāks
revīzija
9846f89a2c
2 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 4 0
      converse.js
  2. 1 0
      docs/CHANGES.rst

+ 4 - 0
converse.js

@@ -3612,6 +3612,10 @@
                 if ($form) {
                     $form.find('input[type=submit]').hide().after('<span class="spinner login-submit"/>');
                 }
+                var resource = Strophe.getResourceFromJid(jid);
+                if (!resource) {
+                    jid += '/converse.js-' + Math.floor(Math.random()*139749825).toString();
+                }
                 converse.connection = new Strophe.Connection(converse.bosh_service_url);
                 converse.connection.connect(jid, password, converse.onConnect);
             },

+ 1 - 0
docs/CHANGES.rst

@@ -20,6 +20,7 @@ Changelog
   Message forwarding was before a default behavior but is now optional (and disabled by default). [jcbrand]
 * Newly opened chat boxes always appear immediately left of the controlbox. [jcbrand]
 * #71 Chat boxes and rooms can be minimized. [jcbrand]
+* #123 Show converse.js in the resource assigned to a user. [jcbrand]
 * #130 Fixed bootstrap conflicts. [jcbrand]
 * #132 Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html'>`_.
   Configured via `enable_message_carbons <https://conversejs.org/docs/html/index.html#enable_message_carbons>`_ [hejazee]