X-Git-Url: http://git.vpit.fr/?p=perl%2Fscripts%2Fxchat.git;a=blobdiff_plain;f=hl.pl;h=e4692ef775a2ab2ddaf887bf9fc3e640cd86fc22;hp=5b67967ec415e0b07257c06280ca3b209e6bec09;hb=HEAD;hpb=70c8dbe5c65630fd27994d34a748fd05f2d5f968 diff --git a/hl.pl b/hl.pl index 5b67967..e4692ef 100755 --- a/hl.pl +++ b/hl.pl @@ -3,29 +3,24 @@ 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.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 @@ -48,7 +43,7 @@ my %hl = ( rgit- subs-auto \bwith- - / ], + > ], ); for (keys %hl) { @@ -57,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; @@ -78,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; @@ -95,6 +90,6 @@ $ph = Xchat::XPI->new( email => 'perl@profvince.com', url => 'http://www.profvince.com', ); - + 1;