]> git.donarmstrong.com Git - infobot.git/commitdiff
- fixed dns lookup
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 26 May 2001 13:34:15 +0000 (13:34 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 26 May 2001 13:34:15 +0000 (13:34 +0000)
- fixed "tell blah about literal x"
- getChanConf() overwrote $chan - fixed.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@497 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Question.pl
src/IRC/Schedulers.pl
src/Modules/RootWarn.pl
src/Process.pl
src/UserExtra.pl
src/core.pl
src/db_mysql.pl

index eab0d5f050ffd4feef8e1b69acd22d420b0d6784..0abb9bb0c5bcabc8c3a4437f53b596d3f9f8cda5 100644 (file)
@@ -45,6 +45,11 @@ sub doQuestion {
        return if (exists $bots{$nuh});
     }
 
+    if ($query =~ s/^literal\s+//i) {
+       &status("literal ask of '$query'.");
+       $literal = 1;
+    }
+
     # convert to canonical reference form
     my $x;
     my @query;
index eee0c5918af87452d17a07261201628ff4b12381..9b9150705a4b1bb9d2e094ef4360caf15d3319cf 100644 (file)
@@ -1078,7 +1078,7 @@ sub factoidCheck {
        my $fix = $_;
        $fix =~ s/ #DEL#$//g;
        my $agestr = &Time2String($time - $age);
-       &DEBUG("safedel: Removing '$_' for good. [$agestr old]");
+       &status("safedel: Removing '$_' for good. [$agestr old]");
 
        &delFactoid($_);
     }
index 185130f31718077a5943afe73a2f2d123c70fb04..05e9d3f43b6283bf712df5a4a8db9112dc920bd8 100644 (file)
@@ -13,11 +13,11 @@ sub rootWarn {
     my $warnmode       = &getChanConf("rootWarnMode");
 
     if ($attempt == 0) {       # first timer.
-       if ($warnmode =~ /aggressive/i) {
-           &status(">>> Detected root user; notifying nick and channel.");
+       if (defined $warnmode and $warnmode =~ /aggressive/i) {
+           &status("rootwarn: Detected root user; notifying nick and channel.");
            rawout("PRIVMSG $chan :R".("O" x int(rand 80 + 2))."T has landed!");
        } else {
-           &status(">>> Detected root user; notifying user");
+           &status("rootwarn: Detected root user; notifying user");
        }
 
        if ($_ = &getFactoid("root")) {
index 925ae964cbfb17865cdbfcb8bacfcde04ceef2c7..4988e67e91a7548c2799cdf696a2dba04d458447 100644 (file)
@@ -271,11 +271,6 @@ sub process {
     ### bot commands...
     ###
 
-    if ($message =~ s/^literal\s+//i) {
-       &status("literal ask of '$message'.");
-       $literal = 1;
-    }
-
     # karma. set...
     if ($message =~ /^(\S+)(--|\+\+)\s*$/ and $addressed) {
        return '' unless (&hasParam("karma"));
index 2467660d32be75ed35b5d04cbb6862a0c75f0da8..b48158c9765deec2187de2a644d9986c832a3e4d 100644 (file)
@@ -356,7 +356,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,6 +390,7 @@ 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");
@@ -406,11 +407,11 @@ sub 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";
        }
index 87ebb64c184f621308af49c8da16f81810bd3d5f..36e8c76b66eca42a3d37072b62892305937abd22 100644 (file)
@@ -268,23 +268,30 @@ sub IsChanConf {
 #  About: Retrieve value for 'param' value in current/default chan.
 # Return: scalar for success, undef for failure.
 sub getChanConf {
-    my($param,$chan)   = @_;
+    my($param,$c)      = @_;
 
     if (!defined $param) {
        &WARN("param == NULL.");
        return 0;
     }
 
-    $chan      ||= "_default";
-    my @c      = grep /^$chan$/i, keys %chanconf;
+    # this looks evil... 
+    if (0 and !defined $chan) {
+       &DEBUG("gCC: ok !chan... doing _default instead.");
+    }
+
+    $c         ||= $chan;
+    $c         ||= "_default";
+    my @c      = grep /^$c$/i, keys %chanconf;
 
     if (@c) {
-       if ($c[0] ne $chan) {
+       if (0 and $c[0] ne $c) {
            &WARN("c ne chan ($c[0] ne $chan)");
        }
        return $chanconf{$c[0]}{$param};
     }
 
+#    &DEBUG("gCC: returning _default... ");
     return $chanconf{"_default"}{$param};
 }
 
index 38b12296f6a88aa3c78156692fe0d60dfba52ea4..4c31e5a9f7e41e3b171616c116940f9b3e9a7e6f 100644 (file)
@@ -234,6 +234,11 @@ sub dbReplace {
        }
     }
 
+    if (0) {
+       &DEBUG("REPLACE INTO $table (".join(',',@keys).
+               ") VALUES (". join(',',@vals). ")" );
+    }
+
     &dbRaw("Replace($table)", "REPLACE INTO $table (".join(',',@keys).
                ") VALUES (". join(',',@vals). ")"
     );