Connection dialog removed from the server panel
[KiwiIRC.git] / client / assets / dev / model_gateway.js
index abe95d882b64b358904ad8371590c8e0418a3cae..0cf09fb7ed6cf946896d377e0c23646ebe1dbdfb 100644 (file)
@@ -132,14 +132,9 @@ _kiwi.model.Gateway = function () {
 \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
@@ -153,7 +148,7 @@ _kiwi.model.Gateway = function () {
 \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
@@ -182,13 +177,7 @@ _kiwi.model.Gateway = function () {
          * 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
@@ -244,7 +233,7 @@ _kiwi.model.Gateway = function () {
 \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