summaryrefslogtreecommitdiffstats
path: root/scripts/noisyquery.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
commit03929dac2a29664878d2c971648a4fe1fb698462 (patch)
tree02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/noisyquery.pl
parentInitial commit. (diff)
downloadirssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.tar.xz
irssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.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.pl33
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');