diff options
| author | 2016-01-07 19:55:36 -0700 | |
|---|---|---|
| committer | 2016-01-07 19:55:36 -0700 | |
| commit | 645cc36c05909b0ffd0ec9423e3633c8a1b8673b (patch) | |
| tree | 434152404ce86d9150c442cf71c474dfcc815c59 /lib/ASM/Classes.pm | |
| parent | 1cb83fe999b03d2c913ca409650036a8d4dd462e (diff) | |
Use Tie::CPHash to make %::sn and %::sc case-insensitiveish.
Clean up commands.xml and fix some bugs
Add clone detection
Minimize some excessive warnings
Greatly improve syncing speed
Diffstat (limited to 'lib/ASM/Classes.pm')
| -rw-r--r-- | lib/ASM/Classes.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/ASM/Classes.pm b/lib/ASM/Classes.pm index 2fae035..1f0e3ef 100644 --- a/lib/ASM/Classes.pm +++ b/lib/ASM/Classes.pm @@ -37,13 +37,26 @@ sub new "garbagemeter" => \&garbagemeter, "cyclebotnet" => \&cyclebotnet, "banevade" => \&banevade, - "urlcrunch" => \&urlcrunch + "urlcrunch" => \&urlcrunch, + "cloning" => \&cloning }; $self->{ftbl} = $tbl; bless($self); return $self; } +sub cloning { + my ($chk, $id, $event, $chan, $rev) = @_; + my $max = int($chk->{content}); + my @nicks = grep {($::sn{$_}->{host} eq $event->{host}) && (lc $chan ~~ $::sn{$_}->{mship})} keys %::sn; + # It's lines like these that make me love Perl no matter how much it drives dwfreed up a tree. + # Understanding how that line works is simple and is left as an exercise to the reader. + if ($#nicks >= $max) { + return ASM::Util->commaAndify(@nicks); + } + return 0; +} + sub garbagemeter { my ($chk, $id, $event, $chan, $rev) = @_; my @cut = split(/:/, $chk->{content}); |
