Attempt to reconnect only after 5 seconds.

This commit is contained in:
JC Brand 2015-06-07 18:26:32 +02:00
parent d6bb3f8502
commit 94514dfe1e

View File

@ -550,15 +550,17 @@
);
};
this.reconnect = function () {
converse.giveFeedback(__('Reconnecting'), 'error');
this.reconnect = function (condition) {
converse.log('Attempting to reconnect in 5 seconds');
converse.giveFeedback(__('Attempting to reconnect in 5 seconds'), 'error');
setTimeout(function () {
if (converse.authentication !== "prebind") {
this.connection.connect(
this.connection.jid,
this.connection.pass,
function (status, condition) {
converse.onConnectStatusChanged(status, condition, true);
},
this.onConnectStatusChanged(status, condition, true);
}.bind(this),
this.connection.wait,
this.connection.hold,
this.connection.route
@ -568,6 +570,7 @@
this._tearDown();
this.startNewBOSHSession();
}
}.bind(this), 5000);
};
this.renderLoginPanel = function () {