summaryrefslogtreecommitdiffstats
path: root/scripts/whois.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/whois.pl')
-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');