gateway kiwi_server setting now only set in one place
authorDarren <darren@darrenwhitlen.com>
Mon, 6 Jan 2014 10:20:00 +0000 (10:20 +0000)
committerDarren <darren@darrenwhitlen.com>
Mon, 6 Jan 2014 10:20:00 +0000 (10:20 +0000)
client/src/models/application.js
client/src/models/gateway.js
client/src/models/newconnection.js

index cad12beb6e121c140171012b2bf6fc4381d3fbd7..aba7fcc3b2c23eeec7d70666a5be8d013cc1028e 100644 (file)
@@ -442,8 +442,6 @@ _kiwi.model.Application = function () {
                 if (serv[serv.length-1] === '/')\r
                     serv = serv.substring(0, serv.length-1);\r
 \r
-                _kiwi.app.kiwi_server = serv;\r
-\r
                 // Force the jumpserver now?\r
                 if (data.force) {\r
                     // Get an interval between 5 and 6 minutes so everyone doesn't reconnect it all at once\r
@@ -458,7 +456,7 @@ _kiwi.model.Application = function () {
                         that.message.text(msg, {timeout: 8000});\r
 \r
                         setTimeout(function forcedReconnectPartTwo() {\r
-                            _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server);\r
+                            _kiwi.app.kiwi_server = serv;\r
 \r
                             _kiwi.gateway.reconnect(function() {\r
                                 // Reconnect all the IRC connections\r
index 0a010b7734d0d2b22006212a7b4a3cc9ed79b8ca..122930fc29c9e1727469a92f594b98294d94c8bf 100644 (file)
@@ -151,6 +151,9 @@ _kiwi.model.Gateway = function () {
     *   @param  {Function}  callback    A callback function to be invoked once Kiwi's server has connected to the IRC server\r
     */\r
     this.connect = function (callback) {\r
+        // Keep note of the server we are connecting to\r
+        this.set('kiwi_server', _kiwi.app.kiwi_server);\r
+\r
         this.socket = new EngineioTools.ReconnectingSocket(this.get('kiwi_server'), {\r
             path: _kiwi.app.get('base_path') + '/transport',\r
             reconnect_max_attempts: 5,\r
index 8d1b558f1ba905f97bca076e6b916dc4ba72ec58..90db39b1ab5b4aa22743694353ff5b44a9209592 100644 (file)
@@ -16,7 +16,6 @@ _kiwi.model.NewConnection = Backbone.Collection.extend({
 
         // If not connected already, connect then send the IRC connect info
         if (!_kiwi.gateway.isConnected()) {
-            _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server);
             _kiwi.gateway.connect(function() {
                 that.makeConnection(new_connection_event);
             });