From e5baa247b7c7d079af4a6a70f2f91909d7a6360f Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 6 Jan 2014 10:20:00 +0000 Subject: [PATCH] gateway kiwi_server setting now only set in one place --- client/src/models/application.js | 4 +--- client/src/models/gateway.js | 3 +++ client/src/models/newconnection.js | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/models/application.js b/client/src/models/application.js index cad12be..aba7fcc 100644 --- a/client/src/models/application.js +++ b/client/src/models/application.js @@ -442,8 +442,6 @@ _kiwi.model.Application = function () { if (serv[serv.length-1] === '/') serv = serv.substring(0, serv.length-1); - _kiwi.app.kiwi_server = serv; - // Force the jumpserver now? if (data.force) { // Get an interval between 5 and 6 minutes so everyone doesn't reconnect it all at once @@ -458,7 +456,7 @@ _kiwi.model.Application = function () { that.message.text(msg, {timeout: 8000}); setTimeout(function forcedReconnectPartTwo() { - _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server); + _kiwi.app.kiwi_server = serv; _kiwi.gateway.reconnect(function() { // Reconnect all the IRC connections diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 0a010b7..122930f 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -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 */ this.connect = function (callback) { + // Keep note of the server we are connecting to + this.set('kiwi_server', _kiwi.app.kiwi_server); + this.socket = new EngineioTools.ReconnectingSocket(this.get('kiwi_server'), { path: _kiwi.app.get('base_path') + '/transport', reconnect_max_attempts: 5, diff --git a/client/src/models/newconnection.js b/client/src/models/newconnection.js index 8d1b558..90db39b 100644 --- a/client/src/models/newconnection.js +++ b/client/src/models/newconnection.js @@ -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); }); -- 2.25.1