use strict;
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "0.1";
%IRSSI = (
    authors     => 'Tom Laermans (SiD3WiNDR)',
    contact     => 'sid3windr@sid3windr.be',
    name        => 'raw338',
    description => 'Prints the real hostname (as returned by e.g. Ratbox) in right format',
    license     => 'GPL',
    url         => 'http://www.codemonkey.be',
);

Irssi::theme_register([whois_actually => '[%Wx%n] hostname : $1']);

sub event_whois_actually {
	my ($server, $data) = @_;

	my ($num, $nick, $real_host, $crap) = split(/ +/, $_[1], 4);

	$server->printformat($nick, MSGLEVEL_CRAP, 'whois_actually', $nick, $real_host);
	Irssi::signal_stop();
}

Irssi::signal_add('event 338', 'event_whois_actually');
