html/noisyquery.pl
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
6 use Irssi;
7
8 $VERSION="0.1.1";
9 %IRSSI = (
10 authors=> 'unknown',
11 contact=> 'bd@bc-bd.org',
12 name=> 'noisyquery',
13 description=> 'Prints an info about a newly started Query in your current window and runs a /whois on the nick.',
14 license=> 'GPL v2',
15 url=> 'http://bc-bd.org/software.php3#irssi',
16 );
17
18 sub sig_query() {
19 my ($query, $auto) = @_;
20
21 # don't say anything if we did /query,
22 # or if query went to active window
23 my $refnum = $query->window()->{refnum};
24 my $window = Irssi::active_win();
25 if ($auto && $refnum != $window->{refnum}) {
26 $window->print("Query started with ".$query->{name}." in window $refnum");
27 $query->{server}->command("whois ".$query->{name});
28 }
29 }
30
31 Irssi::signal_add_last('query created', 'sig_query');