kick: onKick,
quit: onQuit,
privmsg: onMsg,
+ action: onAction,
notice: onNotice,
ctcp_request: onCtcpRequest,
ctcp_response: onCtcpResponse,
}
+function onAction(event) {
+ var that = this;
+
+ global.modules.emit('irc action', {
+ channel: this,
+ connection: this.irc_connection,
+ irc_event: event
+ })
+ .done(function() {
+ that.irc_connection.clientEvent('action', {
+ nick: event.nick,
+ ident: event.ident,
+ hostname: event.hostname,
+ channel: event.channel,
+ msg: event.msg,
+ time: event.time
+ });
+ });
+}
+
+
function onNotice(event) {
var that = this;
if ((msg.charAt(0) === String.fromCharCode(1)) && (msg.charAt(msg.length - 1) === String.fromCharCode(1))) {
//CTCP request
if (msg.substr(1, 6) === 'ACTION') {
- this.irc_connection.clientEvent('action', {
+ namespace = (command.params[0].toLowerCase() === this.irc_connection.nick.toLowerCase()) ?
+ 'user ' + command.nick :
+ 'channel ' + command.params[0];
+
+ this.irc_connection.emit(namespace + ' action', {
nick: command.nick,
ident: command.ident,
hostname: command.hostname,
msg: msg.substring(8, msg.length - 1),
time: time
});
- } else if (msg.substr(1, 4) === 'KIWI') {
- tmp = msg.substring(6, msg.length - 1);
- namespace = tmp.split(' ', 1)[0];
- this.irc_connection.clientEvent('kiwi', {
- namespace: namespace,
- data: tmp.substr(namespace.length + 1),
- time: time
- });
+
} else if (msg.substr(1, 7) === 'VERSION') {
client_info = this.irc_connection.state.client.client_info;
version_string = global.build_version;
}
version_string = 'KiwiIRC (' + version_string + ')';
-
this.irc_connection.write('NOTICE ' + command.nick + ' :' + String.fromCharCode(1) + 'VERSION ' + version_string + String.fromCharCode(1));
+
} else if (msg.substr(1, 6) === 'SOURCE') {
this.irc_connection.write('NOTICE ' + command.nick + ' :' + String.fromCharCode(1) + 'SOURCE http://www.kiwiirc.com/' + String.fromCharCode(1));
+
} else if (msg.substr(1, 10) === 'CLIENTINFO') {
this.irc_connection.write('NOTICE ' + command.nick + ' :' + String.fromCharCode(1) + 'CLIENTINFO SOURCE VERSION TIME' + String.fromCharCode(1));
+
} else {
namespace = (command.params[0].toLowerCase() === this.irc_connection.nick.toLowerCase()) ? 'user' : 'channel';
this.irc_connection.emit(namespace + ' ' + command.nick + ' ctcp_request', {
params.shift();
genericNotice.call(this, command, params.slice(0, -1).join(', ') + ' ' + command.params[command.params.length - 1]);
},
-
+
RPL_HOSTCLOACKING: function (command) {
genericNotice.call(this, command, command.params[1] + ' ' + command.params[command.params.length - 1]);
- },
+ },
};
if (typeof is_error !== 'boolean')
is_error = true;
- this.irc_connection.clientEvent('notice', {
+ this.irc_connection.emit('user ' + command.prefix + ' notice', {
from_server: true,
nick: command.prefix,
ident: '',
notice: onNotice,\r
ctcp_response: onCtcpResponse,\r
privmsg: onPrivmsg,\r
+ action: onAction,\r
ctcp_request: onCtcpRequest,\r
mode: onMode\r
};\r
});\r
}\r
\r
+function onAction(event) {\r
+ var that = this;\r
+\r
+ global.modules.emit('irc action', {\r
+ connection: this.irc_connection,\r
+ irc_event: event\r
+ })\r
+ .done(function() {\r
+ that.irc_connection.clientEvent('action', {\r
+ nick: event.nick,\r
+ ident: event.ident,\r
+ hostname: event.hostname,\r
+ channel: event.channel,\r
+ msg: event.msg,\r
+ time: event.time\r
+ });\r
+ });\r
+}\r
+\r
function onCtcpRequest(event) {\r
this.irc_connection.clientEvent('ctcp_request', {\r
nick: event.nick,\r