if (!$addressed) {
return '' unless ($finalQMark);
return '' if (&IsParam("minVolunteerLength") == 0);
- return '' if (length($query) < $param{'minVolunteerLength'});
+ return '' if (length $query < $param{'minVolunteerLength'});
} else {
### TODO: this should be caught in Process.pl?
return '' unless ($talkok);
# dangerous; common preambles should be stripped before here
if ($query =~ /^forget /i or $query =~ /^no, /) {
- return $noreply if (exists $bots{$nuh});
+ return if (exists $bots{$nuh});
}
# convert to canonical reference form
push(@query, $query); # 1: push original.
+ # valid factoid.
+ if ($query =~ s/[!.]$//) {
+ push(@query,$query);
+ }
+
$x = &normquery($query);
push(@query, $x) if ($x ne $query);
$query = $x;
$questionWord = "where";
}
- # valid factoid.
- if ($query =~ s/[\!\.]$//) {
- &DEBUG("Question: Pushing query without trailing symbols.");
- push(@query,$query);
- }
-
for (my$i=0; $i<scalar(@query); $i++) {
- $query = $query[$i];
+ $query = $query[$i];
$result = &getReply($query);
- next if ($result eq "");
+ next if (!defined $result or $result eq "");
# 'see also' factoid redirection support.
if ($result =~ /^see( also)? (.*?)\.?$/) {
}
if ($i != 0) {
- &DEBUG("Question: guessed factoid correctly ($i) => '$query'.");
+ &DEBUG("Question: '$query[0]' did not exist; '$query[$i]' ($i) did");
}
return $result;
}
### TODO: Use &Forker(); move function to Freshmeat.pl.
- if (&IsParam("freshmeatForFactoid")) {
+ if (&IsChanConf("freshmeatForFactoid")) {
&loadMyModule($myModules{'freshmeat'});
$result = &Freshmeat::showPackage($query);
- return $result unless ($result eq $noreply);
+ return $result if (defined $result);
}
### TODO: Use &Forker(); move function to Debian.pl
- if (&IsParam("debianForFactoid")) {
+ if (&IsChanConf("debianForFactoid")) {
&loadMyModule($myModules{'debian'});
$result = &Debian::DebianFind($query); # ???
### TODO: debian module should tell, through shm, that it went
### ok or not.
-### return $result unless ($result eq $noreply);
+### return $result if (defined $result);
}
if ($questionWord ne "" or $finalQMark) {
# if it has not been explicitly marked as a question
if ($addressed and $reply eq "") {
- &status("notfound: <$who> ".join(' :: ', @query));
+ &status("notfound: <$who> ".join(' :: ', @query))
+ if ($finalQMark);
return '' unless (&IsParam("friendlyBots"));
}
}
- $reply;
+ return $reply;
}
1;