this.gateway.on('userlist_end', onUserlistEnd, this);
this.gateway.on('mode', onMode, this);
this.gateway.on('whois', onWhois, this);
+ this.gateway.on('whowas', onWhowas, this);
this.gateway.on('away', onAway, this);
this.gateway.on('list_start', onListStart, this);
this.gateway.on('irc_error', onIrcError, this);
} else if (event.chans) {
panel.addMsg(event.nick, 'Channels: ' + event.chans, 'whois');
} else if (event.irc_server) {
- panel.addMsg(event.nick, 'Connected to server: ' + event.irc_server, 'whois');
+ panel.addMsg(event.nick, 'Connected to server: ' + event.irc_server + ' ' + event.server_info, 'whois');
} else if (event.msg) {
panel.addMsg(event.nick, event.msg, 'whois');
} else if (event.logon) {
}
}
+ function onWhowas(event) {
+ var panel;
+
+ if (event.end)
+ return;
+
+ panel = _kiwi.app.panels().active;
+ if (event.host) {
+ panel.addMsg(event.nick, event.nick + ' [' + event.nick + ((event.ident)? '!' + event.ident : '') + '@' + event.host + '] * ' + event.real_name, 'whois');
+ } else {
+ panel.addMsg(event.nick, 'No such nick', 'whois');
+ }
+ }
function onAway(event) {
'311': 'RPL_WHOISUSER',
'312': 'RPL_WHOISSERVER',
'313': 'RPL_WHOISOPERATOR',
+ '314': 'RPL_WHOWASUSER',
'317': 'RPL_WHOISIDLE',
'318': 'RPL_ENDOFWHOIS',
'319': 'RPL_WHOISCHANNELS',
'366': 'RPL_ENDOFNAMES',
'367': 'RPL_BANLIST',
'368': 'RPL_ENDOFBANLIST',
+ '369': 'RPL_ENDOFWHOWAS',
'372': 'RPL_MOTD',
'375': 'RPL_MOTDSTART',
'376': 'RPL_ENDOFMOTD',
'401': 'ERR_NOSUCHNICK',
'404': 'ERR_CANNOTSENDTOCHAN',
'405': 'ERR_TOOMANYCHANNELS',
+ '406': 'ERR_WASNOSUCHNICK',
'421': 'ERR_UNKNOWNCOMMAND',
'422': 'ERR_NOMOTD',
'432': 'ERR_ERRONEUSNICKNAME',
'RPL_WHOISSERVER': function (command) {
this.irc_connection.emit('user ' + command.params[1] + ' whoisserver', {
nick: command.params[1],
- irc_server: command.params[2]
+ irc_server: command.params[2],
+ server_info: command.trailing
});
},
});
},
+ 'RPL_WHOWASUSER': function (command) {
+ this.irc_connection.emit('user ' + command.params[1] + ' whowas', {
+ nick: command.params[1],
+ ident: command.params[2],
+ host: command.params[3],
+ real_name: command.trailing
+ });
+ },
+
+ 'RPL_ENDOFWHOWAS': function (command) {
+ this.irc_connection.emit('user ' + command.params[1] + ' endofwhowas', {
+ nick: command.params[1]
+ });
+ },
+
+ 'ERR_WASNOSUCHNICK': function (command) {
+ this.irc_connection.emit('user ' + command.params[1] + ' wasnosucknick', {
+ nick: command.params[1]
+ });
+ },
+
'RPL_LISTSTART': function (command) {
this.irc_connection.emit('server ' + this.irc_connection.irc_host.hostname + ' list_start', {});
},
whoismodes: onWhoisModes,\r
whoisidle: onWhoisIdle,\r
whoisregnick: onWhoisRegNick,\r
+ whoisserver: onWhoisServer,\r
endofwhois: onWhoisEnd,\r
+ whowas: onWhoWas,\r
+ endofwhowas: onWhoWasEnd,\r
+ wasnosuchnick: onWasNoSuchNick,\r
notice: onNotice,\r
ctcp_response: onCtcpResponse,\r
privmsg: onPrivmsg,\r
this.irc_connection.clientEvent('whois', {\r
nick: event.nick,\r
irc_server: event.irc_server,\r
+ server_info: event.server_info,\r
end: false\r
});\r
}\r
});\r
}\r
\r
+function onWhoWas(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ ident: event.user,\r
+ host: event.host,\r
+ real_name: event.real_name,\r
+ end: false\r
+ });\r
+}\r
+\r
+function onWasNoSuchNick(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ end: false\r
+ });\r
+}\r
+\r
+function onWhoWasEnd(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ end: true\r
+ });\r
+}\r
+\r
function onNotice(event) {\r
this.irc_connection.clientEvent('notice', {\r
from_server: event.from_server,\r