From ec68dc1cf074bd8c617e870ac383ab238a6d779d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 27 Jun 2019 15:19:32 +0200 Subject: [PATCH] Always set JID on the connection So that the resource is passed along when we manually bind. Related to bd81b897240aa83bd36ed0a6dc898c0c8cf5d97f --- src/headless/converse-core.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/headless/converse-core.js b/src/headless/converse-core.js index 7e1091d23..cf85624d8 100644 --- a/src/headless/converse-core.js +++ b/src/headless/converse-core.js @@ -528,14 +528,14 @@ async function initUserSession (jid) { async function setUserJID (jid) { await initUserSession(jid); jid = _converse.session.get('jid') || jid; - if (!Strophe.getResourceFromJid(jid)) { jid = jid.toLowerCase() + _converse.generateResource(); - // Set JID on the connection object so that when we call - // `connection.bind` the new resource is found by Strophe.js - // and sent to the XMPP server. - _converse.connection.jid = jid; } + // Set JID on the connection object so that when we call + // `connection.bind` the new resource is found by Strophe.js + // and sent to the XMPP server. + _converse.connection.jid = jid; + _converse.jid = jid; _converse.bare_jid = Strophe.getBareJidFromJid(jid); _converse.resource = Strophe.getResourceFromJid(jid);