From 9846f89a2c791416781ab3a100f6377fbe726fc4 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Mon, 14 Jul 2014 23:09:39 +0200 Subject: [PATCH] If no resource exists, add one which mentions converse.js updates #123 --- converse.js | 4 ++++ docs/CHANGES.rst | 1 + 2 files changed, 5 insertions(+) diff --git a/converse.js b/converse.js index 70be6d128..19558b8ba 100644 --- a/converse.js +++ b/converse.js @@ -3612,6 +3612,10 @@ if ($form) { $form.find('input[type=submit]').hide().after(''); } + 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); }, diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index cd4f9f82d..f83227bf9 100644 --- a/docs/CHANGES.rst +++ b/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 `_. Configured via `enable_message_carbons `_ [hejazee]