Network objects listening for IRC connection events only
authorDarren <darren@darrenwhitlen.com>
Mon, 16 Jun 2014 13:00:57 +0000 (14:00 +0100)
committerDarren <darren@darrenwhitlen.com>
Mon, 16 Jun 2014 13:00:57 +0000 (14:00 +0100)
client/src/app.js
client/src/models/application.js
client/src/models/gateway.js

index ca479370f91de068b0fd663e5358dd33afb8e6f1..2b7b0af7016c93ddff7b259535fa8253379b2c87 100644 (file)
@@ -84,6 +84,8 @@ _kiwi.global = {
 \r
             if (typeof connection_id !== 'undefined') {\r
                 connection_event = 'connection:' + connection_id.toString();\r
+            } else {\r
+                connection_event = 'connection';\r
             }\r
 \r
             var obj = new this.EventComponent(_kiwi.gateway, connection_event);\r
index ef12636bf1c28a9bbb096b2bd72580b7a2282690..cf47c5960a650761eced9cb259e0de4ae753148f 100644 (file)
         bindGatewayCommands: function (gw) {\r
             var that = this;\r
 \r
-            gw.on('connect', function (event) {\r
+            // As soon as an IRC connection is made, show the full client UI\r
+            gw.on('connection:connect', function (event) {\r
                 that.view.barsShow();\r
             });\r
 \r
index 1bad0a4156eb991cb94975577e87fbc91e9ec72f..1eddbdee0889609c426b6924834be8e3438ba33d 100644 (file)
@@ -242,7 +242,8 @@ _kiwi.model.Gateway = function () {
         }\r
 \r
         // Trigger the global events\r
-        that.trigger(command, data);\r
+        that.trigger('connection', {event_name: command, event_data: data});\r
+        that.trigger('connection:' + command, data);\r
     };\r
 \r
     this.rpcCall = function(method, connection_id) {\r