]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
- fixed "news #debian latest" - how did I break it?
[infobot.git] / src / UserExtra.pl
index 46436caae1a12eb81750c111754c0e7ed1475640..067370bf861739b88093dee1d38a6f0753ed61a5 100644 (file)
@@ -219,7 +219,7 @@ sub factstats {
 
 sub karma {
     my $target = lc( shift || $who );
-    my $karma  = &dbGet("karma", "nick",$target,"karma") || 0;
+    my $karma  = &dbGet("stats", "counter", "nick='$target' and type='karma'") || 0;
 
     if ($karma != 0) {
        &pSReply("$target has karma of $karma");
@@ -325,10 +325,9 @@ sub tell {
 
     # "intrusive".
 #    if ($target !~ /^$mask{chan}$/ and !&IsNickInAnyChan($target)) {
-    if ($target !~ /^$mask{chan}$/) {
-       &msg($who, "No, $target is not in any of my chans.");
-       return;
-    }
+#      &msg($who, "No, $target is not in any of my chans.");
+#      return;
+#    }
 
     # self.
     if ($target eq $ident) {   # lc?
@@ -356,7 +355,7 @@ sub tell {
        $message        = $tell_obj;
        $done++ unless (&Modules());
 
-       &VERB("teel: setting old values of who and msgType.",2);
+       &VERB("tell: setting old values of who and msgType.",2);
        $who            = $oldwho;
        $msgType        = $oldmtype;
 
@@ -390,10 +389,12 @@ sub DNS {
     my $dns = shift;
     my($match, $x, $y, $result);
     my $pid;
+    $dns =~ s/^\s+|\s+$//g;
 
     if ($dns =~ /(\d+\.\d+\.\d+\.\d+)/) {
        &status("DNS query by IP address: $in");
        $match = $1;
+
        $y = pack('C4', split(/\./, $match));
        $x = (gethostbyaddr($y, &AF_INET));
 
@@ -402,12 +403,14 @@ sub DNS {
        } else {
            $result = "I can't seem to find that address in DNS";
         }
+
     } else {
-       &status("DNS query by name: $in");
-       $x = join('.',unpack('C4',(gethostbyname($in))[4]));
+
+       &status("DNS query by name: $dns");
+       $x = join('.',unpack('C4',(gethostbyname($dns))[4]));
 
        if ($x !~ /^\s*$/) {
-           $result = $in." is ".$x;
+           $result = $dns." is ".$x;
        } else {
            $result = "I can\'t find that machine name";
        }