Merge branch 'i18n' into development
[KiwiIRC.git] / client / assets / src / models / application.js
index 3fd84f0aaf0b168bd01901ab7778731ed117814b..2f4c2d9c735c01d73a670cfea6ea678d3a721713 100644 (file)
@@ -32,6 +32,11 @@ _kiwi.model.Application = function () {
 \r
             // Takes instances of model_network\r
             this.connections = new _kiwi.model.NetworkPanelList();\r
+\r
+            // Set any default settings before anything else is applied\r
+            if (this.server_settings && this.server_settings.client && this.server_settings.client.settings) {\r
+                this.applyDefaultClientSettings(this.server_settings.client.settings);\r
+            }\r
         };\r
 \r
 \r
@@ -49,7 +54,6 @@ _kiwi.model.Application = function () {
 \r
             this.initializeClient();\r
             this.initializeGlobals();\r
-            this.applyDefaultClientSettings(this.server_settings.client.settings);\r
 \r
             this.view.barsHide(true);\r
 \r
@@ -181,6 +185,9 @@ _kiwi.model.Application = function () {
 \r
                 if (this.server_settings.client.channel)\r
                     defaults.channel = this.server_settings.client.channel;\r
+\r
+                if (this.server_settings.client.channel_key)\r
+                    defaults.channel_key = this.server_settings.client.channel_key;\r
             }\r
 \r
 \r
@@ -285,6 +292,10 @@ _kiwi.model.Application = function () {
                     defaults.channel = this.server_settings.connection.channel;\r
                 }\r
 \r
+                if (this.server_settings.connection.channel_key) {\r
+                    defaults.channel_key = this.server_settings.connection.channel_key;\r
+                }\r
+\r
                 if (this.server_settings.connection.nick) {\r
                     defaults.nick = this.server_settings.connection.nick;\r
                 }\r