1# prints "Query started with nick in window x" when query windows are
2# created automatically. For irssi 0.7.98
3
4# 21.08.2001 bd@bc-bd.org :: added automatic whois
5
6use strict;
7use Irssi;
8use vars qw($VERSION %IRSSI);
9
10$VERSION="0.1.1";
11%IRSSI = (
12	authors=> 'unknown',
13	contact=> 'bd@bc-bd.org',
14	name=> 'noisyquery',
15	description=> 'Prints an info about a newly started Query in your current window and runs a /whois on the nick.',
16	license=> 'GPL v2',
17	url=> 'http://bc-bd.org/software.php3#irssi',
18);
19
20sub sig_query() {
21	my ($query, $auto) = @_;
22
23	# don't say anything if we did /query,
24	# or if query went to active window
25	my $refnum = $query->window()->{refnum};
26	my $window = Irssi::active_win();
27	if ($auto && $refnum != $window->{refnum}) {
28		$window->print("Query started with ".$query->{name}." in window $refnum");
29		$query->{server}->command("whois ".$query->{name});
30	}
31}
32
33Irssi::signal_add_last('query created', 'sig_query');
34