]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
make sure chanstats don't flood
[infobot.git] / src / UserExtra.pl
index 9923a092115a3aa652ae4c7d241a1d12bef254fb..c09291ef9a31184d5ac200fe6e25d55abf5c4866 100644 (file)
@@ -148,6 +148,13 @@ sub chaninfo {
 
     # Step 3:
     ### TODO: what's wrong with the following?
+    foreach (keys %userstats) {
+       next if (exists $userstats{$_}{'Count'});
+       delete $userstats{$_};
+       $delete++;
+    }
+    &DEBUG("chanstats: delete: $delete... nowtotal => ".scalar(keys %userstats) );
+
     my %new = map { $userstats{$_}{'Count'} => $_ } keys %userstats;
     my($count) = (sort { $b <=> $a } keys %new)[0];
     if ($count) {