Commit 1fbc7e0f authored by JC Brand's avatar JC Brand

Use attemptNonPreboundSession for reconnections.

Fixes reconnects for certain usecases not yet covered.
parent e0d1a32f
...@@ -429,23 +429,14 @@ ...@@ -429,23 +429,14 @@
converse.giveFeedback(__('Attempting to reconnect in 5 seconds'), 'error'); converse.giveFeedback(__('Attempting to reconnect in 5 seconds'), 'error');
window.clearTimeout(converse.reconnectTimeout); window.clearTimeout(converse.reconnectTimeout);
converse.reconnectTimeout = window.setTimeout(function () { converse.reconnectTimeout = window.setTimeout(function () {
converse.clearSession();
converse._tearDown();
if (converse.authentication !== "prebind") { if (converse.authentication !== "prebind") {
this.connection.connect( converse.attemptNonPreboundSession();
this.connection.jid,
this.connection.pass,
function (status, condition) {
this.onConnectStatusChanged(status, condition, true);
}.bind(this),
this.connection.wait,
this.connection.hold,
this.connection.route
);
} else if (converse.prebind_url) { } else if (converse.prebind_url) {
this.clearSession(); converse.startNewBOSHSession();
this._tearDown();
this.startNewBOSHSession();
} }
}.bind(this), 5000); }, 5000);
}; };
this.onDisconnected = function (condition) { this.onDisconnected = function (condition) {
......
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