]> git.vpit.fr Git - perl/scripts/xchat.git/blobdiff - hl.pl
Make sure local_context() runs the code only when the context was found
[perl/scripts/xchat.git] / hl.pl
diff --git a/hl.pl b/hl.pl
index fdaaf5cb89477d755e54fc52d7b37c39b0a3539c..e4692ef775a2ab2ddaf887bf9fc3e640cd86fc22 100755 (executable)
--- a/hl.pl
+++ b/hl.pl
@@ -3,49 +3,47 @@ package Xchat::VPIT::Highlight;
 use strict;
 use warnings;
 
-use Xchat qw/:all/;
+use Xchat qw<:all>;
 
 use lib get_info 'xchatdir';
 use Xchat::XPI;
-use Xchat::XPI::Events qw/filter/;
+use Xchat::XPI::Events qw<filter>;
+use Xchat::XPI::Utils  qw<irc_lc gui>;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 my $ph;
 
-sub guihl {
- command 'GUI FLASH';
- command 'GUI COLOR 3';
-}
-
-sub guiclear {
- command 'GUI COLOR 0';
-}
-
-hook_print 'Private Message to Dialog', sub { guihl; return EAT_NONE };
+hook_print 'Private Message to Dialog', sub {
+ gui 'highlight';
+ return EAT_NONE;
+};
 
 my %hl = (
- '#cpantesters' => [ qw/
+ '#cpantesters' => [ qw<
     Acme-CPANAuthors-You-re_using
     B-RecDeparse
+    Bit-MorseSignals
     CPANPLUS-Dist-Gentoo
+    IPC-MorseSignals
     Lexical-Types
     Linux-SysInfo
-    MorseSignals
     Perl-Critic-Policy-Dynamic-NoIndirect
     Regexp-Wildcards
     Scalar-Vec-Util
     Scope-Upper
     Sub-Nary
+    Sub-Op
     Sub-Prototype-Util
     Test-Valgrind
     Thread-Cleanup
     Variable-Magic
+    autovivification-
     indirect-
     rgit-
     subs-auto
-    with-
-  / ],
+    \bwith-
+  > ],
 );
 
 for (keys %hl) {
@@ -54,9 +52,9 @@ for (keys %hl) {
 }
 
 filter 'Channel Action' => sub {
- my $chan = lc get_info 'channel';
+ my $chan = irc_lc get_info 'channel';
  if ($hl{$chan} and $_[1] =~ /$hl{$chan}/) {
-  guihl;
+  gui 'highlight';
   1;
  } else {
   0;
@@ -75,9 +73,9 @@ for (keys %skip) {
 }
 
 filter 'Channel Action Hilight' => sub {
- my $chan = lc get_info 'channel';
+ my $chan = irc_lc get_info 'channel';
  if ($skip{$chan} and $_[1] =~ /$skip{$chan}/) {
-  guiclear;
+  gui 'clear';
   1;
  } else {
   0;
@@ -92,6 +90,6 @@ $ph = Xchat::XPI->new(
  email  => 'perl@profvince.com',
  url    => 'http://www.profvince.com',
 );
+
 1;