]> git.donarmstrong.com Git - infobot.git/commitdiff
more reasonable default limits and messages
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 20 Nov 2002 18:26:47 +0000 (18:26 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 20 Nov 2002 18:26:47 +0000 (18:26 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@631 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Core.pl

index 9b36852eba1119ea17d7340e266b5a20dc4990f0..0d4b6dba91d8b7eda3ba4626eaca39a6085af2c6 100644 (file)
@@ -153,10 +153,12 @@ sub FactoidStuff {
 
        my $author      = &getFactInfo($faqtoid, "created_by");
        my $count       = &getFactInfo($faqtoid, "requested_count") || 0;
+       # don't delete if requested $limit times
        my $limit       = &getChanConfDefault(
                                "factoidPreventForgetLimit", 100, $chan);
+       # don't delete if older than $limitage seconds (modified by requests below)
        my $limitage    = &getChanConfDefault(
-                               "factoidPreventForgetLimitTime", 180, $chan);
+                               "factoidPreventForgetLimitTime", 7 * 24 * 60 * 60, $chan);
        my $t           = &getFactInfo($faqtoid, "created_time") || 0;
        my $age         = time() - $t;
 
@@ -179,13 +181,14 @@ sub FactoidStuff {
 
        # factoidPreventForgetLimitTime:
        if (!($isop or $isau) and $age/(60*60*24) > $limitage) {
-           &msg($who, "cannot remove factoid '$faqtoid' since it is protected by Time.");
+           &msg($who, "cannot remove factoid '$faqtoid', too old. (" .
+                   $age/(60*60*24) . ">$limitage) use 'no,' instead");
            return;
        }
 
        # factoidPreventForgetLimit:
        if (!($isop or $isau) and $limit and $count > $limit) {
-           &msg($who, "will not delete '$faqtoid', count > limit ($count > $limit)");
+           &msg($who, "will not delete '$faqtoid', count > limit ($count > $limit) use 'no, ' instead.");
            return;
        }