From: Darren Date: Mon, 16 Jun 2014 13:00:57 +0000 (+0100) Subject: Network objects listening for IRC connection events only X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=18ae1a72c0402209452dd923e34a5b89f7b1fe71;p=KiwiIRC.git Network objects listening for IRC connection events only --- 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) {