diff --git a/CHANGES.rst b/CHANGES.rst index 2df18b3d2..425e812b0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,46 +4,28 @@ Changelog 0.4 (Unreleased) ---------------- -- CSS tweaks: fixed overflowing text in status message and chatrooms list. - [jcbrand] -- Bugfix: Couldn't join chatroom when clicking from a list of rooms. - [jcbrand] -- Add better support for kicking or banning users from chatrooms. - [jcbrand] -- Fixed alignment of chat messages in Firefox. - [jcbrand] -- More intelligent fetching of vCards. - [jcbrand] -- Fixed a race condition bug. Make sure that the roster is populated before - sending initial presence. - [jcbrand] +- CSS tweaks: fixed overflowing text in status message and chatrooms list. [jcbrand] +- Bugfix: Couldn't join chatroom when clicking from a list of rooms. [jcbrand] +- Add better support for kicking or banning users from chatrooms. [jcbrand] +- Fixed alignment of chat messages in Firefox. [jcbrand] +- More intelligent fetching of vCards. [jcbrand] +- Fixed a race condition bug. Make sure that the roster is populated before sending initial presence. [jcbrand] +- Reconnect automatically when the connection drops. [jcbrand] 0.3 (2013-05-21) ---------------- -- Add vCard support - [jcbrand] -- Remember custom status messages upon reload. - [jcbrand] -- Remove jquery-ui dependency. - [jcbrand] -- Use backbone.localStorage to store the contacts roster, open chatboxes and - chat messages. - [jcbrand] -- Fixed user status handling, which wasn't 100% according to the spec. - [jcbrand] -- Separate messages according to day in chats. - [jcbrand] -- Add support for specifying the BOSH bind URL as configuration setting. - [jcbrand] -- Improve the message counter to only increment when the window is not focused - [witekdev] -- Make fetching of list of chatrooms on a server a configuration option. - [jcbrand] -- Use service discovery to show all available features on a room. - [jcbrand] -- Multi-user chatrooms are now configurable. - [jcbrand] +- Add vCard support [jcbrand] +- Remember custom status messages upon reload. [jcbrand] +- Remove jquery-ui dependency. [jcbrand] +- Use backbone.localStorage to store the contacts roster, open chatboxes and chat messages. [jcbrand] +- Fixed user status handling, which wasn't 100% according to the spec. [jcbrand] +- Separate messages according to day in chats. [jcbrand] +- Add support for specifying the BOSH bind URL as configuration setting. [jcbrand] +- Improve the message counter to only increment when the window is not focused [witekdev] +- Make fetching of list of chatrooms on a server a configuration option. [jcbrand] +- Use service discovery to show all available features on a room. [jcbrand] +- Multi-user chatrooms are now configurable. [jcbrand] 0.2 (2013-03-28) diff --git a/converse.js b/converse.js index 7d1a56c00..967dc3249 100644 --- a/converse.js +++ b/converse.js @@ -2464,28 +2464,32 @@ ''), connect: function ($form, jid, password) { - var $button = $form.find('input[type=submit]'), + var button = null, connection = new Strophe.Connection(converse.bosh_service_url); - $button.hide().after(''); + if ($form) { + $button = $form.find('input[type=submit]'); + $button.hide().after(''); + } connection.connect(jid, password, $.proxy(function (status, message) { if (status === Strophe.Status.CONNECTED) { console.log('Connected'); converse.onConnected(connection); } else if (status === Strophe.Status.DISCONNECTED) { - $button.show().siblings('img').remove(); + if ($button) { $button.show().siblings('img').remove(); } converse.giveFeedback('Disconnected', 'error'); + this.connect(null, connection.jid, connection.pass); } else if (status === Strophe.Status.Error) { - $button.show().siblings('img').remove(); + if ($button) { $button.show().siblings('img').remove(); } converse.giveFeedback('Error', 'error'); } else if (status === Strophe.Status.CONNECTING) { converse.giveFeedback('Connecting'); } else if (status === Strophe.Status.CONNFAIL) { - $button.show().siblings('img').remove(); + if ($button) { $button.show().siblings('img').remove(); } converse.giveFeedback('Connection Failed', 'error'); } else if (status === Strophe.Status.AUTHENTICATING) { converse.giveFeedback('Authenticating'); } else if (status === Strophe.Status.AUTHFAIL) { - $button.show().siblings('img').remove(); + if ($button) { $button.show().siblings('img').remove(); } converse.giveFeedback('Authentication Failed', 'error'); } else if (status === Strophe.Status.DISCONNECTING) { converse.giveFeedback('Disconnecting', 'error');