Commit af42bc06 authored by JC Brand's avatar JC Brand

Only close controlbox when logging out

Not when the connection failed due to other reasons (like wrong credentials).
parent c1662c63
......@@ -149,7 +149,7 @@
closeAllChatBoxes: function () {
this.each(function (view) {
if (!converse.connection.connected ||
if (converse.disconnection_cause === converse.LOGOUT ||
view.model.get('id') !== 'controlbox') {
view.close();
}
......@@ -241,7 +241,7 @@
if (this.model.get('connected')) {
this.insertRoster();
}
if (typeof this.model.get('closed')==='undefined') {
if (_.isUndefined(this.model.get('closed'))) {
this.model.set('closed', !converse.show_controlbox_by_default);
}
if (!this.model.get('closed')) {
......
......@@ -479,6 +479,10 @@
converse.connection.disconnect(__('Authentication Failed'));
converse.setDisconnectionCause(status, condition, true);
} else if (status === Strophe.Status.CONNFAIL) {
converse.giveFeedback(
__('Connection failed'), 'error',
__('An error occurred while connecting to the chat server: '+condition)
);
converse.setDisconnectionCause(status, condition);
} else if (status === Strophe.Status.DISCONNECTING) {
converse.setDisconnectionCause(status, 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