Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_converse.setUserJID = async function (jid) {
if (!_converse.connection || !u.isSameDomain(_converse.connection.jid, jid)) {
const domain = Strophe.getDomainFromJid(jid)
await _converse.initConnection(domain);
}
await initSession(jid);
/**
* Triggered whenever the user's JID has been updated
* @event _converse#setUserJID
*/
_converse.api.trigger('setUserJID');
return jid;
}