2000-02-25 12:03:17 -05:00
|
|
|
# /RN - display real name of nick
|
|
|
|
|
|
|
|
use Irssi;
|
2000-10-18 16:50:12 -04:00
|
|
|
use Irssi::Irc;
|
2001-07-16 16:22:45 -04:00
|
|
|
use strict;
|
2000-02-25 12:03:17 -05:00
|
|
|
|
|
|
|
sub cmd_realname {
|
|
|
|
my ($data, $server, $channel) = @_;
|
|
|
|
|
|
|
|
$server->send_raw("WHOIS :$data");
|
|
|
|
|
|
|
|
# ignore all whois replies except "No such nick" or the
|
|
|
|
# first line of the WHOIS reply
|
|
|
|
$server->redirect_event($data, 2,
|
|
|
|
"event 318", "event empty", -1,
|
|
|
|
"event 402", "event 402", -1,
|
|
|
|
"event 401", "event 401", 1,
|
|
|
|
"event 311", "redir whois", 1,
|
|
|
|
"event 301", "event empty", 1,
|
|
|
|
"event 312", "event empty", 1,
|
|
|
|
"event 313", "event empty", 1,
|
|
|
|
"event 317", "event empty", 1,
|
|
|
|
"event 319", "event empty", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub event_rn_whois {
|
2000-12-06 00:42:13 -05:00
|
|
|
my ($num, $nick, $user, $host, $empty, $realname) = split(/ +/, $_[1], 6);
|
2000-02-25 12:03:17 -05:00
|
|
|
$realname =~ s/^://;
|
|
|
|
|
|
|
|
Irssi::print("%_$nick%_ is $realname");
|
|
|
|
}
|
|
|
|
|
2001-02-13 13:19:59 -05:00
|
|
|
Irssi::command_bind('rn', 'cmd_realname');
|
2000-02-25 12:03:17 -05:00
|
|
|
Irssi::signal_add('redir whois', 'event_rn_whois');
|