From: Darren Date: Sun, 1 Jun 2014 10:58:22 +0000 (+0100) Subject: Triggering message:type events X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=afcfe02cb6817292d470ea384452ed87ec7f3805;p=KiwiIRC.git Triggering message:type events --- diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 1de6fa4..4d8e49b 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -224,6 +224,14 @@ _kiwi.model.Gateway = function () { event_name: command, event_data: data }); + + // Some events trigger a more in-depth event name + if (command == 'message' && data.type) { + that.trigger('connection:' + data.connection_id.toString(), { + event_name: 'message:' + data.type, + event_data: data + }); + } } // Trigger the global events