+ # this may eat some memory.
+ # prevent deletion if other factoids redirect to it.
+ # todo: use hash instead of array.
+ my @list;
+ if (&getChanConf("factoidPreventForgetRedirect")) {
+ &status("Factoids/Core: forget: checking for redirect factoids");
+ @list = &searchTable("factoids", "factoid_key",
+ "factoid_value", "^<REPLY> see ");
+ }
+
+ my $match = 0;
+ for (@list) {
+ my $f = $_;
+ my $v = &getFactInfo($f, "factoid_value");
+ my $fsafe = quotemeta($faqtoid);
+ next unless ($v =~ /^<REPLY> ?see( also)? $fsafe\.?$/i);
+
+ &DEBUG("Factoids/Core: match! ($f || $faqtoid)");
+
+ $match++;
+ }
+ # todo: warn for op aswell, but allow force delete.
+ if (!$isop and $match) {
+ &msg($who, "uhm, other (redirection) factoids depend on this one.");
+ return;
+ }
+
+ # minimize abuse.