Triggering message:type events
authorDarren <darren@darrenwhitlen.com>
Sun, 1 Jun 2014 10:58:22 +0000 (11:58 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 1 Jun 2014 10:58:22 +0000 (11:58 +0100)
client/src/models/gateway.js

index 1de6fa4122ffc02af01686861ba85c2383cde63d..4d8e49bb7b50fa337ad77acb821edd99348e065c 100644 (file)
@@ -224,6 +224,14 @@ _kiwi.model.Gateway = function () {
                 event_name: command,\r
                 event_data: data\r
             });\r
+\r
+            // Some events trigger a more in-depth event name\r
+            if (command == 'message' && data.type) {\r
+                that.trigger('connection:' + data.connection_id.toString(), {\r
+                    event_name: 'message:' + data.type,\r
+                    event_data: data\r
+                });\r
+            }\r
         }\r
 \r
         // Trigger the global events\r