]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Question.pl
short and sweet
[infobot.git] / src / Factoids / Question.pl
index 7d6f27cb94b36371ed94496c3c16ed361ce64ea9..b9dfd80cc9ee65fd028706b6ebda97dfa647d34f 100644 (file)
@@ -33,8 +33,8 @@ sub doQuestion {
 
     if (!$addressed) {
        return '' unless ($finalQMark);
-       return '' if (&IsParam("minVolunteerLength") == 0);
-       return '' if (length $query < $param{'minVolunteerLength'});
+       return '' unless &IsChanConf("minVolunteerLength");
+       return '' if (length $query < &::getChanConf('minVolunteerLength'));
     } else {
        ### TODO: this should be caught in Process.pl?
        return '' unless ($talkok);
@@ -132,8 +132,7 @@ sub doQuestion {
                # support command redirection.
                # recursive cmdHooks aswell :)
                my $done = 0;
-               $done++ if &parseCmdHook("main", $link);
-               $done++ if &parseCmdHook("extra", $link);
+               $done++ if &parseCmdHook($link);
                $message        = $link;
                $done++ unless (&Modules());
 
@@ -154,16 +153,9 @@ sub doQuestion {
        return $result;
     }
 
-    ### TODO: Use &Forker(); move function to Freshmeat.pl.
-    if (&IsChanConf("freshmeatForFactoid")) {
-       &loadMyModule($myModules{'freshmeat'});
-       $result = &Freshmeat::showPackage($query);
-       return $result if (defined $result);
-    }
-
     ### TODO: Use &Forker(); move function to Debian.pl
-    if (&IsChanConf("debianForFactoid")) {
-       &loadMyModule($myModules{'debian'});
+    if (&IsChanConf('debianForFactoid')) {
+       &loadMyModule('Debian');
        $result = &Debian::DebianFind($query);  # ???
        ### TODO: debian module should tell, through shm, that it went
        ###       ok or not.
@@ -193,9 +185,9 @@ sub factoidArgs {
 
     # to make it eleeter, split each arg and use "blah OR blah or BLAH"
     # which will make it less than linear => quicker!
-    # todo: cache this, update cache when altered. !!! !!! !!!
+    # TODO: cache this, update cache when altered. !!! !!! !!!
 #    my $t = &timeget();
-    my ($first) = split(/\s+/, $str); 
+    my ($first) = split(/\s+/, $str);
     my @list = &searchTable("factoids", "factoid_key", "factoid_key", "^CMD: $first ");
 #    my $delta_time = &timedelta($t);
 #    &DEBUG("factArgs: delta_time = $delta_time s");
@@ -212,7 +204,7 @@ sub factoidArgs {
 #      &DEBUG("factarg: '$str' =~ /^$_\$/");
        my $arg = $_;
 
-       # todo: <greycat> ~punish apt for (Eating) (Parentheses)
+       # TODO: <greycat> ~punish apt for (Eating) (Parentheses)
        # how the hell do I fix the above? -dms.
 
        # eval (evil!) code. cleaned up courtesy of lear.
@@ -236,7 +228,7 @@ sub factoidArgs {
 #      &DEBUG("vals => @vals");
 
        &status("Question: factoid Arguments for '$str'");
-       # todo: use getReply() - need to modify it :(
+       # TODO: use getReply() - need to modify it :(
        my $i   = 0;
        my $q   = "CMD: $_";
        my $r   = &getFactoid($q);