html/q_username.pl
1 # Prints the Q username in right format
2
3 use strict;
4 use Irssi;
5 use vars qw($VERSION %IRSSI);
6 $VERSION = "0.1";
7 %IRSSI = (
8 authors=> "Teemu \'jamov\' Koskinen",
9 contact=> "teemu.koskinen\@mbnet.fi",
10 name=> "q_username",
11 description=> "Prints the Q username in right format",
12 license=> "Public Domain",
13 );
14
15 Irssi::theme_register([whois_auth => ' authnick : $1']);
16
17 sub event_whois_auth {
18 my ($server, $data) = @_;
19 my ($num, $nick, $auth_nick) = split(/ +/, $_[1], 3);
20 $auth_nick =~ s/\:is authed as //;
21
22 $server->printformat($nick, MSGLEVEL_CRAP, 'whois_auth', $nick, $auth_nick);
23 Irssi::signal_stop();
24 }
25
26 Irssi::signal_add('event 330', 'event_whois_auth');