diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/noisyquery.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.tar.xz irssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/noisyquery.pl')
-rw-r--r-- | scripts/noisyquery.pl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/noisyquery.pl b/scripts/noisyquery.pl new file mode 100644 index 0000000..e11be3b --- /dev/null +++ b/scripts/noisyquery.pl @@ -0,0 +1,33 @@ +# 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 strict; +use Irssi; +use vars qw($VERSION %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'); |