Always set JID on the connection

So that the resource is passed along when we manually bind.

Related to bd81b89724
This commit is contained in:
JC Brand 2019-06-27 15:19:32 +02:00
parent 119966d902
commit ec68dc1cf0

View File

@ -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;
}
_converse.jid = jid;
_converse.bare_jid = Strophe.getBareJidFromJid(jid);
_converse.resource = Strophe.getResourceFromJid(jid);