From 269c83b4b4c4c2dabaaf654c5cba9960adc88f44 Mon Sep 17 00:00:00 2001 From: timriker Date: Fri, 18 Feb 2005 00:28:08 +0000 Subject: [PATCH] maxListReply* now by channel git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1134 c11ca15a-4712-0410-83d8-924469b57eb5 --- files/sample/blootbot.chan | 2 ++ files/sample/blootbot.config | 8 -------- src/Misc.pl | 4 ++-- src/Modules/Factoids.pl | 2 +- src/Modules/Search.pl | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/files/sample/blootbot.chan b/files/sample/blootbot.chan index e6220b7..4125f20 100644 --- a/files/sample/blootbot.chan +++ b/files/sample/blootbot.chan @@ -59,6 +59,8 @@ _default +lart +limitcheck +log + maxListReplyCount 15 + maxListReplyLength 400 +md5 +nickometer +page diff --git a/files/sample/blootbot.config b/files/sample/blootbot.config index 2dde025..eb38c8a 100644 --- a/files/sample/blootbot.config +++ b/files/sample/blootbot.config @@ -143,14 +143,6 @@ set talkMethod DEFAULT # "+" before bot commands overrides this option temporarily. ###set minLengthBeforePrivate 192 -# [int] maximum length of reply for Extras function before popping list to -# reduce number of elements. -set maxListReplyLength 400 - -# [int] maximum number of elements in list allowed for Extras function -# before popping elements to reduce total count. -set maxListReplyCount 15 - # [0/1] allow people outside any channels the bot is on to use the bot # for factoids and commands. set disallowOutsiders 1 diff --git a/src/Misc.pl b/src/Misc.pl index bef0f91..6cb2e7b 100644 --- a/src/Misc.pl +++ b/src/Misc.pl @@ -117,8 +117,8 @@ sub timedelta { sub formListReply { my($rand, $prefix, @list) = @_; my $total = scalar @list; - my $maxshow = $param{'maxListReplyCount'} || 10; - my $maxlen = $param{'maxListReplyLength'} || 400; + my $maxshow = &getChanConfDefault('maxListReplyCount', 15); + my $maxlen = &getChanConfDefault('maxListReplyLength', 400); my $reply; # remove irc overhead diff --git a/src/Modules/Factoids.pl b/src/Modules/Factoids.pl index 50a98ea..56639af 100644 --- a/src/Modules/Factoids.pl +++ b/src/Modules/Factoids.pl @@ -739,7 +739,7 @@ sub CmdFactStats { sub CmdListAuth { my ($query) = @_; - my $maxshow = $::param{'maxListReplyCount'} || 10; + my $maxshow = &::getChanConfDefault('maxListReplyCount', 15); my @list = &searchTable("factoids","factoid_key", "created_by", "^$query!"); @list=grep(!/\#DEL\#$/,@list) if (scalar(@list) > $maxshow); diff --git a/src/Modules/Search.pl b/src/Modules/Search.pl index 01a5ff0..9f3ab77 100644 --- a/src/Modules/Search.pl +++ b/src/Modules/Search.pl @@ -13,7 +13,7 @@ sub Search { my ($type, $str) = @_; my $start_time = &::timeget(); my @list; - my $maxshow = $::param{'maxListReplyCount'} || 10; + my $maxshow = &::getChanConfDefault('maxListReplyCount', 15); $type =~ s/s$//; # nice work-around. -- 2.39.2