From 18ae1a72c0402209452dd923e34a5b89f7b1fe71 Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 16 Jun 2014 14:00:57 +0100 Subject: [PATCH] Network objects listening for IRC connection events only --- client/src/app.js | 2 ++ client/src/models/application.js | 3 ++- client/src/models/gateway.js | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/app.js b/client/src/app.js index ca47937..2b7b0af 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -84,6 +84,8 @@ _kiwi.global = { if (typeof connection_id !== 'undefined') { connection_event = 'connection:' + connection_id.toString(); + } else { + connection_event = 'connection'; } var obj = new this.EventComponent(_kiwi.gateway, connection_event); diff --git a/client/src/models/application.js b/client/src/models/application.js index ef12636..cf47c59 100644 --- a/client/src/models/application.js +++ b/client/src/models/application.js @@ -167,7 +167,8 @@ bindGatewayCommands: function (gw) { var that = this; - gw.on('connect', function (event) { + // As soon as an IRC connection is made, show the full client UI + gw.on('connection:connect', function (event) { that.view.barsShow(); }); diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 1bad0a4..1eddbde 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -242,7 +242,8 @@ _kiwi.model.Gateway = function () { } // Trigger the global events - that.trigger(command, data); + that.trigger('connection', {event_name: command, event_data: data}); + that.trigger('connection:' + command, data); }; this.rpcCall = function(method, connection_id) { -- 2.25.1