summaryrefslogtreecommitdiffstats
path: root/scripts/whois.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/whois.pl
parentInitial commit. (diff)
downloadirssi-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 '')
-rw-r--r--scripts/whois.pl38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/whois.pl b/scripts/whois.pl
new file mode 100644
index 0000000..e6be917
--- /dev/null
+++ b/scripts/whois.pl
@@ -0,0 +1,38 @@
+# whois.pl/Irssi/fahren@bochnia.pl
+
+use Irssi;
+use strict;
+
+use vars qw($VERSION %IRSSI);
+$VERSION = "1.0";
+%IRSSI = (
+ authors => "Maciek \'fahren\' Freudenheim",
+ contact => "fahren\@bochnia.pl",
+ name => "cwhois",
+ description => "Hilights \'@\' in whois channel reply",
+ license => "GNU GPLv2 or later",
+ changed => "Fri Mar 15 15:09:42 CET 2002"
+);
+
+Irssi::theme_register([
+ 'cwhois_channels', '{whois channels %|$1}'
+]);
+
+sub event_cwhois
+{
+ my ($server, $data) = @_;
+
+ my ($nick, $chans) = $data =~ /([\S]+)\s:(.*)/;
+
+ my $ret;
+ foreach my $chan (split(/ /, $chans)) {
+ $ret .= (($chan =~ s/^@//)? "\00316@\003" : "") . $chan . " ";
+ }
+
+ chop $ret;
+ $server->printformat($nick, MSGLEVEL_CRAP, 'cwhois_channels', $nick, $ret);
+
+ Irssi::signal_stop();
+}
+
+Irssi::signal_add('event 319', 'event_cwhois');