diff options
| author | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
|---|---|---|
| committer | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
| commit | 2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1 (patch) | |
| tree | 1c5e6d817c88e67b46e216a50e0aef5428bf63df /scripts/noisyquery.pl | |
| parent | 2d080422d79d1fd49d6c5528593ccaaff9bfc583 (diff) | |
| download | scripts.irssi.org-2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1.tar.bz2 | |
Import scripts from scripts.irssi.org
Diffstat (limited to 'scripts/noisyquery.pl')
| -rw-r--r-- | scripts/noisyquery.pl | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/scripts/noisyquery.pl b/scripts/noisyquery.pl new file mode 100644 index 0000000..94328a1 --- /dev/null +++ b/scripts/noisyquery.pl @@ -0,0 +1,31 @@ +# prints "Query started with nick in window x" when query windows are +# created automatically. For irssi 0.7.98 + +# 21.08.2001 bd@bc-bd.org :: added automatic whois + +use Irssi; + +$VERSION="0.1.1"; +%IRSSI = ( +	authors=> 'unknown', +	contact=> 'bd@bc-bd.org', +	name=> 'noisyquery', +	description=> 'Prints an info about a newly started Query in your current window and runs a /whois on the nick.', +	license=> 'GPL v2', +	url=> 'http://bc-bd.org/software.php3#irssi', +); + +sub sig_query() { +	my ($query, $auto) = @_; + +	# don't say anything if we did /query, +	# or if query went to active window +	my $refnum = $query->window()->{refnum}; +	my $window = Irssi::active_win(); +	if ($auto && $refnum != $window->{refnum}) { +		$window->print("Query started with ".$query->{name}." in window $refnum"); +		$query->{server}->command("whois ".$query->{name}); +	} +} + +Irssi::signal_add_last('query created', 'sig_query'); | 
