}
}
+ # override msgType.
+ if ($msgType =~ /public/ and $message =~ s/^\+//) {
+ &status("found '+' flag; setting msgType to public.");
+ $force_public_reply++;
+ $msgType = 'public';
+ $who = $chan; # major hack to fix &msg().
+ &DEBUG("addressed => $addressed.");
+ }
+
# User Processing, for all users.
if ($addressed) {
my $retval;
### bot commands...
###
- # override msgType.
- if ($msgType =~ /public/ and $message =~ s/^\+//) {
- &status("found '+' flag; setting msgType to public.");
- $force_public_reply++;
- $msgType = 'public';
- }
-
if ($message =~ s/^literal\s+//i) {
&status("literal ask of '$message'.");
$literal = 1;
}
}
-
# factoid forget.
if ($message =~ s/^forget\s+//i) {
return 'forget: no addr' unless ($addressed);
return 'locked factoid' if (&IsLocked($faqtoid) == 1);
if (&IsParam("factoidDeleteDelay")) {
+ if ($faqtoid =~ /#DEL#/ and !&IsFlag("o")) {
+ &msg($who, "cannot delete it ($faqtoid).");
+ return;
+ }
&status("forgot (safe delete): <$who> '$faqtoid' =is=> '$result'");
### TODO: check if the "backup" exists and overwrite it
my $check = &getFactoid("$faqtoid #DEL#");
if (!$check) {
- &setFactInfo($faqtoid, "factoid_key", $faqtoid." #DEL#");
-
- &setFactInfo($faqtoid, "modified_by", $who);
- &setFactInfo($faqtoid, "modified_time", time());
+ if ($faqtoid !~ /#DEL#/) {
+ &setFactInfo($faqtoid, "factoid_key", $faqtoid." #DEL#");
+
+ &setFactInfo($faqtoid, "modified_by", $who);
+ &setFactInfo($faqtoid, "modified_time", time());
+ } else {
+ &status("not backing up $faqtoid.");
+ }
} else {
&status("forget: not overwriting backup!");
}
return;
}
-
# Fix up $message for question.
- for ($message) {
+ my $question = $message;
+ for ($question) {
# fix the string.
s/^hey([, ]+)where/where/i;
s/whois/who is/ig;
$correction_plausible = 0;
}
- my $result = &doQuestion($message);
+ my $result = &doQuestion($question);
if (!defined $result or $result eq $noreply) {
return 'result from doQ undef.';
}