nicklistEnd: onNicklistEnd,
banlist: onBanList,
banlist_end: onBanListEnd,
- topicsetby: onTopicSetby
+ topicsetby: onTopicSetby,
+ mode: onMode
};
});
};
+function onMode(event) {
+ this.irc_connection.clientEvent('mode', {
+ target: event.target,
+ nick: event.nick,
+ modes: event.modes
+ });
+};
+
/*
server:event
prefixes = this.irc_connection.options.PREFIX || [],
always_param = (chanmodes[0] || '').concat((chanmodes[1] || '')),
modes = [],
- has_param, i, j, add;
+ has_param, i, j, add, event;
prefixes = _.reduce(prefixes, function (list, prefix) {
list.push(prefix.mode);
}
}
- this.client.sendIrcCommand('mode', {
- server: this.con_num,
+ event = (_.contains(this.irc_connection.options.CHANTYPES, command.params[0][0]) ? 'channel' : 'user') + command.params[0] + ':mode';
+
+ this.irc_connection.emit(event, {
target: command.params[0],
nick: command.nick || command.prefix || '',
modes: modes
notice: onNotice,\r
ctcp_response: onCtcpResponse,\r
privmsg: onPrivmsg,\r
- ctcp_request: onCtcpRequest\r
+ ctcp_request: onCtcpRequest,\r
+ mode: onMode\r
};\r
\r
function onNick(event) {\r
msg: event.msg\r
});\r
};\r
+\r
+function onMode(event) {\r
+ this.irc_connection.clientEvent('mode', {\r
+ target: event.target,\r
+ nick: event.nick,\r
+ modes: event.modes\r
+ });\r
+};\r