]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
- I broke maths when I tried to fix "999!" - fixed :-)
[infobot.git] / src / UserExtra.pl
index 2672304ae90728e9999c00bd476c881a96030fbe..46436caae1a12eb81750c111754c0e7ed1475640 100644 (file)
@@ -152,10 +152,15 @@ sub chaninfo {
     my %new;
     foreach (keys %userstats) {
        next unless (exists $userstats{$_}{'Count'});
+       if ($userstats{$_}{'Count'} =~ /^\D+$/) {
+           &WARN("userstats{$_}{Count} is non-digit.");
+           next;
+       }
+
        $new{$_} = $userstats{$_}{'Count'};
     }
 
-    my($count) = (sort { $b <=> $a } keys %new)[0];
+    my($count) = (sort { $a <=> $b } keys %new)[0];
     if ($count) {
        $reply .= ".  \002$count\002 has said the most with a total of \002$new{$count}\002 messages";
     }
@@ -319,13 +324,12 @@ sub tell {
     &status("tell: target = $target, query = $query");  
 
     # "intrusive".
-    if ($target !~ /^$mask{chan}$/ and !&IsNickInAnyChan($target)) {
+#    if ($target !~ /^$mask{chan}$/ and !&IsNickInAnyChan($target)) {
+    if ($target !~ /^$mask{chan}$/) {
        &msg($who, "No, $target is not in any of my chans.");
        return;
     }
 
-    ### TODO: don't "tell" if sender is not in target's channel.
-
     # self.
     if ($target eq $ident) {   # lc?
        &msg($who, "Isn't that a bit silly?");