summaryrefslogtreecommitdiffstats
path: root/modules/classes.pl
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-10-08 13:28:23 +0000
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2007-10-08 13:28:23 +0000
commit917638dfdf31e26ae9115dabb5c2fe528866c549 (patch)
treed5ab13c057983bff1fac0ed64638bb105f8f03b7 /modules/classes.pl
parent3790452619828dc2c5d27c13eeec7b67b3fe6eff (diff)
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.
Diffstat (limited to 'modules/classes.pl')
-rw-r--r--modules/classes.pl8
1 files changed, 5 insertions, 3 deletions
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;
}