kiwi_server no longer read from _kiwi.app
authorDarren <darren@darrenwhitlen.com>
Mon, 6 Oct 2014 20:38:44 +0000 (21:38 +0100)
committerDarren <darren@darrenwhitlen.com>
Mon, 6 Oct 2014 20:38:44 +0000 (21:38 +0100)
client/src/models/application.js
client/src/models/gateway.js

index aab897d362c14ca3c419a43099cd3b34f50c3b55..4456c59d10b326205648ecfdeef0271f29d62f6f 100644 (file)
@@ -7,10 +7,9 @@
         /** _kiwi.view.StatusMessage */\r
         message: null,\r
 \r
-        /* Address for the kiwi server */\r
-        kiwi_server: null,\r
-\r
         initialize: function (options) {\r
+            this.app_options = options;\r
+\r
             if (options.container) {\r
                 this.set('container', options.container);\r
             }\r
@@ -30,9 +29,6 @@
             this.themes = options.themes || [];\r
             this.text_theme = options.text_theme || {};\r
 \r
-            // Best guess at where the kiwi server is if not already specified\r
-            this.kiwi_server = options.kiwi_server || this.detectKiwiServer();\r
-\r
             // The applet to initially load\r
             this.startup_applet_name = options.startup || 'kiwi_startup';\r
 \r
 \r
 \r
         initializeInterfaces: function () {\r
+            // Best guess at where the kiwi server is if not already specified\r
+            var kiwi_server = this.app_options.kiwi_server || this.detectKiwiServer();\r
+\r
             // Set the gateway up\r
-            _kiwi.gateway = new _kiwi.model.Gateway();\r
+            _kiwi.gateway = new _kiwi.model.Gateway({kiwi_server: kiwi_server});\r
             this.bindGatewayCommands(_kiwi.gateway);\r
 \r
             this.initializeClient();\r
                         that.message.text(msg, {timeout: 8000});\r
 \r
                         setTimeout(function forcedReconnectPartTwo() {\r
-                            _kiwi.app.kiwi_server = serv;\r
+                            _kiwi.gateway.set('kiwi_server', serv);\r
 \r
                             _kiwi.gateway.reconnect(function() {\r
                                 // Reconnect all the IRC connections\r
index 4fe707d70959032df2e0a1bf92c9df07d9353785..c479aaf09bce70333cfeb35ebb240fa3e6416971 100644 (file)
@@ -30,9 +30,6 @@ _kiwi.model.Gateway = Backbone.Model.extend({
 \r
         this.connect_callback = callback;\r
 \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
             transports: _kiwi.app.server_settings.transports || ['polling', 'websocket'],\r
             path: _kiwi.app.get('base_path') + '/transport',\r