Commit c2143f61 authored by JC Brand's avatar JC Brand

Bugfix. Converse.js stopped reconnecting

When `_doDisconnect` is called in Strophe, `authentication` is set to
`false`, so reconnection wouldn't happen anymnore

Updates #1490
parent 2b5aeb5e
......@@ -375,23 +375,18 @@ export const api = _converse.api = {
_converse.connection._proto = new Strophe.Websocket(_converse.connection);
_converse.connection.service = api.settings.get("websocket_url");
}
}
if (conn_status === Strophe.Status.AUTHFAIL && api.settings.get("authentication") === _converse.ANONYMOUS) {
} else if (conn_status === Strophe.Status.AUTHFAIL && api.settings.get("authentication") === _converse.ANONYMOUS) {
// When reconnecting anonymously, we need to connect with only
// the domain, not the full JID that we had in our previous
// (now failed) session.
await _converse.setUserJID(api.settings.get("jid"));
}
if (_converse.connection.authenticated) {
if (_converse.connection.reconnecting) {
debouncedReconnect();
} else {
return reconnect();
}
} else {
log.warn("Not attempting to reconnect because we're not authenticated");
}
},
/**
......@@ -1370,7 +1365,7 @@ async function getLoginCredentialsFromBrowser () {
function cleanup () {
// Make sure everything is reset in case this is a subsequent call to
// convesre.initialize (happens during tests).
// converse.initialize (happens during tests).
_converse.router.history.stop();
unregisterGlobalEventHandlers();
delete _converse.controlboxtoggle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment