Commit a3dc23bf authored by JC Brand's avatar JC Brand

Bugfix. When trying to reconnect: 'connection' is not defined.

Conflicts:
	converse.js
parent 86eef5b1
...@@ -201,7 +201,11 @@ ...@@ -201,7 +201,11 @@
$button = $form.find('input[type=submit]'); $button = $form.find('input[type=submit]');
if ($button) { $button.show().siblings('span').remove(); } if ($button) { $button.show().siblings('span').remove(); }
converse.giveFeedback(__('Disconnected'), 'error'); converse.giveFeedback(__('Disconnected'), 'error');
converse.connection.connect(connection.jid, connection.pass, converse.onConnect); converse.connection.connect(
converse.connection.jid,
converse.connection.pass,
converse.onConnect
);
} else if (status === Strophe.Status.Error) { } else if (status === Strophe.Status.Error) {
$form = $('#converse-login'); $form = $('#converse-login');
$button = $form.find('input[type=submit]'); $button = $form.find('input[type=submit]');
...@@ -219,6 +223,11 @@ ...@@ -219,6 +223,11 @@
converse.giveFeedback(__('Authentication Failed'), 'error'); converse.giveFeedback(__('Authentication Failed'), 'error');
} else if (status === Strophe.Status.DISCONNECTING) { } else if (status === Strophe.Status.DISCONNECTING) {
converse.giveFeedback(__('Disconnecting'), 'error'); converse.giveFeedback(__('Disconnecting'), 'error');
converse.connection.connect(
converse.connection.jid,
converse.connection.pass,
converse.onConnect
);
} else if (status === Strophe.Status.ATTACHED) { } else if (status === Strophe.Status.ATTACHED) {
converse.log('Attached'); converse.log('Attached');
converse.onConnected(); converse.onConnected();
...@@ -359,9 +368,7 @@ ...@@ -359,9 +368,7 @@
this.connection.xmlInput = function (body) { console.log(body); }; this.connection.xmlInput = function (body) { console.log(body); };
this.connection.xmlOutput = function (body) { console.log(body); }; this.connection.xmlOutput = function (body) { console.log(body); };
Strophe.log = function (level, msg) { console.log(level+' '+msg); }; Strophe.log = function (level, msg) { console.log(level+' '+msg); };
Strophe.error = function (msg) { Strophe.error = function (msg) { console.log('ERROR: '+msg); };
console.log('ERROR: '+msg);
};
} }
this.bare_jid = Strophe.getBareJidFromJid(this.connection.jid); this.bare_jid = Strophe.getBareJidFromJid(this.connection.jid);
this.domain = Strophe.getDomainFromJid(this.connection.jid); this.domain = Strophe.getDomainFromJid(this.connection.jid);
......
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