\r
/**\r
* Connects to the server\r
- * @param {String} nick The nickname of the user to use on the network\r
- * @param {String} host The hostname or IP address of the IRC server to connect to\r
- * @param {Number} port The port of the IRC server to connect to\r
- * @param {Boolean} ssl Whether or not to connect to the IRC server using SSL\r
- * @param {String} password The password to supply to the IRC server during registration\r
* @param {Function} callback A callback function to be invoked once Kiwi's server has connected to the IRC server\r
*/\r
- this.connect = function (nick, host, port, ssl, password, callback) {\r
+ this.connect = function (callback) {\r
var resource;\r
\r
// Work out the resource URL for socket.io\r
\r
this.socket = io.connect(this.get('kiwi_server'), {\r
'resource': resource,\r
- \r
+\r
'try multiple transports': true,\r
'connect timeout': 3000,\r
'max reconnection attempts': 7,\r
* IRCD and the nick has been accepted.\r
*/\r
this.socket.on('connect', function () {\r
- that.newConnection({\r
- nick: nick,\r
- host: host,\r
- port: port,\r
- ssl: ssl,\r
- password: password\r
- }, callback);\r
+ callback && callback();\r
/*\r
this.emit('kiwi', {command: 'connect', nick: that.get('nick'), hostname: host, port: port, ssl: ssl, password:password}, function (err, server_num) {\r
if (!err) {\r
\r
if (!err) {\r
// TODO: Remove this whole premature connection thing when panel code is tidied\r
- if (server_num != 0 && !_kiwi.app.connections.getByConnectionId(server_num)){\r
+ if (!_kiwi.app.connections.getByConnectionId(server_num)){\r
connection = new _kiwi.model.Network({connection_id: server_num});\r
_kiwi.app.connections.add(connection);\r
}\r