From 917638dfdf31e26ae9115dabb5c2fe528866c549 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Mon, 8 Oct 2007 13:28:23 +0000 Subject: added a db command, improved the user set flags command, added linked channels, added a showhilights command, eliminated flooding of alerts, fixed nickspam check, added something to watch chancounts. --- modules/classes.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/classes.pl') diff --git a/modules/classes.pl b/modules/classes.pl index 4233d88..36a8031 100644 --- a/modules/classes.pl +++ b/modules/classes.pl @@ -3,6 +3,7 @@ package ASM::Classes; use strict; use warnings; use Text::LevenshteinXS qw(distance); +use Data::Dumper; my %sf = (); @@ -93,9 +94,10 @@ sub nickspam { my ($chk, $id, $event, $chan) = @_; my @cut = split(/:/, $chk->{content}); if ( length $event->{args}->[0] >= int($cut[0]) ) { - %_ = map { $_=>$_ } lc keys %{$::sc{lc $chan}{users}}; - my @uniq = grep( $_{$_}, split( / / , lc $event->{args}->[0]) ); - return 1 if ( $#{ @uniq } >= int($cut[1]) ); + my %users = %{$::sc{lc $chan}->{users}}; + my %x = map { $_=>$_ } keys %users; + my @uniq = grep( $x{$_}, split( /[ ,]+/ , lc $event->{args}->[0]) ); + return 1 if ( @uniq >= int($cut[1]) ); } return 0; } -- cgit v1.2.3