From: Jack Allnutt Date: Tue, 13 Aug 2013 21:58:11 +0000 (+0100) Subject: Have client refetch settings on reconfig X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=645fe41b105a0d29f28e4f7f4928fe760b4fd0b1;p=KiwiIRC.git Have client refetch settings on reconfig --- diff --git a/client/assets/src/models/application.js b/client/assets/src/models/application.js index db5e696..b8832ab 100644 --- a/client/assets/src/models/application.js +++ b/client/assets/src/models/application.js @@ -341,6 +341,8 @@ _kiwi.model.Application = function () { this.bindGatewayCommands = function (gw) { + var that = this; + gw.on('onconnect', function (event) { that.view.barsShow(); }); @@ -407,6 +409,17 @@ _kiwi.model.Application = function () { }); })(); + gw.on('kiwi:reconfig', function () { + $.getJSON(that.get('base_path') + '/assets/settings.json', function (data) { + console.log(data); + if (typeof data.kiwi_server !== 'undefined') { + _kiwi.app.kiwi_server = data.kiwi_server; + } + + that.server_settings = data.server_settings || {}; + that.translations = data.translations || {}; + }); + }); }; diff --git a/server/kiwi.js b/server/kiwi.js index 42ef9bc..26d5b9c 100755 --- a/server/kiwi.js +++ b/server/kiwi.js @@ -146,6 +146,13 @@ global.servers = { +config.on('loaded', function () { + for (var client in global.clients.clients) { + global.clients.clients[client].sendKiwiCommand('reconfig'); + } +}); + + /* * Identd server