From: Doug Freed Date: Sat, 21 Jan 2023 09:05:27 +0000 (+0000) Subject: trigger: some minor fixes X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8e930b50237ba9464938414e3c686b3708928b24;p=irssi-scripts.irssi.org.git trigger: some minor fixes Correctly handle statusmsg with multiple prefixes. Make it possible to delete negated filters with change. --- diff --git a/scripts/trigger.pl b/scripts/trigger.pl index 5719984..348c386 100644 --- a/scripts/trigger.pl +++ b/scripts/trigger.pl @@ -23,7 +23,7 @@ use Text::ParseWords; use IO::File; use vars qw($VERSION %IRSSI); -$VERSION = '1.3.0'; +$VERSION = '1.3.1'; %IRSSI = ( authors => 'Wouter Coekaerts', contact => 'wouter@coekaerts.be', @@ -196,9 +196,11 @@ my @signals = ( 'types' => ['publics'], 'signal' => 'message irc op_public', 'sub' => sub { - my ($prefix, $channel); + my ($prefix, $channel, $statusmsg); $channel = $_[4]; - $prefix = substr($channel, 0, 1, ''); + $statusmsg = quotemeta($_[0]->isupport('statusmsg') // '@'); + $channel =~ s/^([$statusmsg]+)//; + $prefix = $1; check_signal_message(\@_,1,$_[0],$channel,$_[2],$_[3],'publics',{'prefix'=>$prefix}); }, }, @@ -1177,7 +1179,7 @@ ARGS: for (my $arg = shift @args; $arg; $arg = shift @args) { } # -no - if ($option =~ /^no(.*)$/ && $filters{$1}) { + if ($option =~ /^no((not_)?(.*))$/ && $filters{$3}) { delete $trigger->{'filters'}->{$1}; } }