event_data: data\r
});\r
}\r
+\r
+ if (command == 'channel' && data.type) {\r
+ that.trigger('connection:' + data.connection_id.toString(), {\r
+ event_name: 'channel:' + data.type,\r
+ event_data: data\r
+ });\r
+ }\r
}\r
\r
// Trigger the global events\r
this.gateway.on('options', onOptions, this);
this.gateway.on('motd', onMotd, this);
- this.gateway.on('join', onJoin, this);
- this.gateway.on('part', onPart, this);
- this.gateway.on('quit', onQuit, this);
- this.gateway.on('kick', onKick, this);
+ this.gateway.on('channel:join', onJoin, this);
+ this.gateway.on('channel:part', onPart, this);
+ this.gateway.on('channel:quit', onQuit, this);
+ this.gateway.on('channe:kick', onKick, this);
this.gateway.on('message', onMessage, this);
this.gateway.on('nick', onNick, this);
this.gateway.on('ctcp_request', onCtcpRequest, this);
irc_event: event
})
.done(function() {
- that.irc_connection.clientEvent('join', {
+ that.irc_connection.clientEvent('channel', {
+ type: 'join',
channel: that.name,
nick: event.nick,
ident: event.ident,
irc_event: event
})
.done(function() {
- that.irc_connection.clientEvent('part', {
+ that.irc_connection.clientEvent('channel', {
+ type: 'part',
nick: event.nick,
ident: event.ident,
hostname: event.hostname,
irc_event: event
})
.done(function() {
- that.irc_connection.clientEvent('kick', {
+ that.irc_connection.clientEvent('channel', {
+ type: 'kick',
kicked: event.kicked, // Nick of the kicked
nick: event.nick, // Nick of the kicker
ident: event.ident,
irc_event: event
})
.done(function() {
- that.irc_connection.clientEvent('quit', {
+ that.irc_connection.clientEvent('channel', {
+ type: 'quit',
nick: event.nick,
ident: event.ident,
hostname: event.hostname,