X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FFactoids%2FQuestion.pl;h=0b7ae04c658755ccb7cce13c0d30136bff23d941;hb=efd0559a232976fc23bdc81ac895d0bff0c267e7;hp=06ab16cde4cc1828d83f3c2397060b3a52ec26cb;hpb=92b9f7705f46bc7f96fe74d2aa65af622bd44ce6;p=infobot.git diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index 06ab16c..0b7ae04 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -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()); @@ -155,8 +154,8 @@ sub doQuestion { } ### 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. @@ -189,7 +188,7 @@ sub factoidArgs { # TODO: cache this, update cache when altered. !!! !!! !!! # my $t = &timeget(); my ($first) = split(/\s+/, $str); - my @list = &searchTable("factoids", "factoid_key", "factoid_key", "^CMD: $first "); + my @list = &searchTable("factoids", "factoid_key", "factoid_key", "^cmd: $first "); # my $delta_time = &timedelta($t); # &DEBUG("factArgs: delta_time = $delta_time s"); # &DEBUG("factArgs: list => ".scalar(@list) ); @@ -201,7 +200,7 @@ sub factoidArgs { foreach (sort { length($b) <=> length($a) } @list) { next if (/#DEL#/); # deleted. - s/^CMD: //i; + s/^cmd: //i; # &DEBUG("factarg: '$str' =~ /^$_\$/"); my $arg = $_; @@ -231,7 +230,7 @@ sub factoidArgs { &status("Question: factoid Arguments for '$str'"); # TODO: use getReply() - need to modify it :( my $i = 0; - my $q = "CMD: $_"; + my $q = "cmd: $_"; my $r = &getFactoid($q); if (!defined $r) { &DEBUG("question: !result... should this happen?");