From: timriker Date: Wed, 20 Nov 2002 18:26:47 +0000 (+0000) Subject: more reasonable default limits and messages X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bb0cc5e0902a05cfb82a5a8704b2c1a249765326;p=infobot.git more reasonable default limits and messages git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@631 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Factoids/Core.pl b/src/Factoids/Core.pl index 9b36852..0d4b6db 100644 --- a/src/Factoids/Core.pl +++ b/src/Factoids/Core.pl @@ -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; }