X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=hl.pl;h=0a9fa11984c0ea16ce1e882daef191c1b7463de0;hb=532ed2d6f4e5597f1dd76e71f2bd9880c5d779bb;hp=97a80af38e7a4b922a76c69721d47b26d67e13eb;hpb=304986c32ddd8652698a79b909da39e8656c2f8b;p=perl%2Fscripts%2Fxchat.git diff --git a/hl.pl b/hl.pl index 97a80af..0a9fa11 100755 --- 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; +use Xchat::XPI::Utils qw; -our $VERSION = '0.02'; +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) { @@ -56,7 +54,7 @@ for (keys %hl) { filter 'Channel Action' => sub { my $chan = lc get_info 'channel'; if ($hl{$chan} and $_[1] =~ /$hl{$chan}/) { - guihl; + gui 'highlight'; 1; } else { 0; @@ -77,19 +75,21 @@ for (keys %skip) { filter 'Channel Action Hilight' => sub { my $chan = lc get_info 'channel'; if ($skip{$chan} and $_[1] =~ /$skip{$chan}/) { - guiclear; + gui 'clear'; 1; } else { 0; } } => 'Channel Action'; -$ph = new Xchat::XPI name => 'Smart highlighting', - tag => 'HL', - desc => 'Highlight on private messages', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; - +$ph = Xchat::XPI->new( + name => 'Smart highlighting', + tag => 'HL', + desc => 'Highlight on private messages', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); + 1;