summaryrefslogtreecommitdiffstats
path: root/lib/ASM/Classes.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ASM/Classes.pm')
-rw-r--r--lib/ASM/Classes.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ASM/Classes.pm b/lib/ASM/Classes.pm
index 8c874b5..325b71d 100644
--- a/lib/ASM/Classes.pm
+++ b/lib/ASM/Classes.pm
@@ -16,6 +16,7 @@ sub new
my $tbl = {
"strbl" => \&strbl,
"strblnew" => \&strblnew,
+ "strblpcre" => \&strblpcre,
"dnsbl" => \&dnsbl,
"floodqueue" => \&floodqueue,
"floodqueue2" => \&floodqueue2,
@@ -395,6 +396,7 @@ sub strblnew {
my ($chk, $xid, $event, $chan) = @_;
my $match = lc $event->{args}->[0];
foreach my $id (keys %{$::blacklist->{string}}) {
+ next unless $::blacklist->{string}->{$id}->{type} eq "string";
my $line = lc $::blacklist->{string}->{$id}->{content};
my $idx = index $match, $line;
if ( $idx != -1 ) {
@@ -408,6 +410,24 @@ sub strblnew {
return 0;
}
+sub strblpcre {
+ my ($chk, $xid, $event, $chan) = @_;
+ my $match = lc $event->{args}->[0];
+ foreach my $id (keys %{$::blacklist->{string}}) {
+ next unless $::blacklist->{string}->{$id}->{type} eq "pcre";
+ my $line = lc $::blacklist->{string}->{$id}->{content};
+ my $idx = index $match, $line;
+ if ( $match =~ /$line/ ) {
+ my $setby = $::blacklist->{string}->{$id}->{setby};
+ $setby = substr($setby, 0, 1) . "\x02\x02" . substr($setby, 1);
+ return defined($::blacklist->{string}->{$id}->{reason}) ?
+ "id $id added by $setby because $::blacklist->{string}->{$id}->{reason}" :
+ "id $id added by $setby for no reason";
+ }
+ }
+ return 0;
+}
+
sub nick {
my ($chk, $id, $event, $chan) = @_;
if ( lc $event->{nick} eq lc $chk->{content} ) {