diff --git a/cgi-bin/guest_mm.cgi b/cgi-bin/guest_mm.cgi index cdf9d42..640f925 100755 --- a/cgi-bin/guest_mm.cgi +++ b/cgi-bin/guest_mm.cgi @@ -134,20 +134,28 @@ sub params_in { } # Variable set for banned user - my $ban; + my ($ban, $trigger); # Parse the banned names list chomp(my @nameBan = <$nameBans>); for (@nameBan) { - last if $ban; - $ban = 1 if $name =~ /$_/; + last if $ban; + + if ($name =~ /$_/i) { + $ban = 1; + $trigger = $_; + } } # Parse the banned phrases list chomp(my @thoughtCrime = <$thoughtCrimes>); for (@thoughtCrime) { - last if $ban; - $ban = 1 if $message =~ /$_/; + last if $ban; + + if ($message =~ /$_/i) { + $ban = 1; + $trigger = $_; + } } # Send it unless ban is true; else send it to spam if spam chan is @@ -159,11 +167,13 @@ sub params_in { message => "$name from $location says: $message" } ); - } elsif ($spam) { + } + elsif ($spam) { $resource->create( { channel_id => "$spam", - message => "$name from $location says: $message" + message => "$name from $location says: $message\n\n" . + "Spam trigger: `$trigger`" } ); }