Use attemptNonPreboundSession for reconnections.

Fixes reconnects for certain usecases not yet covered.
This commit is contained in:
JC Brand 2016-03-31 13:11:31 +00:00
parent e0d1a32fdb
commit 1fbc7e0f3b

View File

@ -429,23 +429,14 @@
converse.giveFeedback(__('Attempting to reconnect in 5 seconds'), 'error');
window.clearTimeout(converse.reconnectTimeout);
converse.reconnectTimeout = window.setTimeout(function () {
converse.clearSession();
converse._tearDown();
if (converse.authentication !== "prebind") {
this.connection.connect(
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
);
converse.attemptNonPreboundSession();
} else if (converse.prebind_url) {
this.clearSession();
this._tearDown();
this.startNewBOSHSession();
converse.startNewBOSHSession();
}
}.bind(this), 5000);
}, 5000);
};
this.onDisconnected = function (condition) {