From: timriker Date: Thu, 1 Jul 2004 17:52:39 +0000 (+0000) Subject: shorter lists X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8659319c808a0d80d0441a7296eba7affc8dfa51;p=infobot.git shorter lists git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@978 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Misc.pl b/blootbot/src/Misc.pl index 9b6240a..843cbb5 100644 --- a/blootbot/src/Misc.pl +++ b/blootbot/src/Misc.pl @@ -121,6 +121,9 @@ sub formListReply { my $maxlen = $param{'maxListReplyLength'} || 400; my $reply; + # remove irc overhead + $maxlen -= 30; + # no results. return $prefix ."returned no results." unless ($total); @@ -140,9 +143,9 @@ sub formListReply { # form the reply. while () { - $reply = $prefix ."(\002". scalar(@list). "\002 shown"; - $reply .= "; \002$total\002 total" if ($total != scalar @list); - $reply .= "): ". join(" \002;;\002 ", @list) ."."; + $reply = $prefix ."(\002". scalar(@list). "\002"; + $reply .= " of \002$total\002" if ($total != scalar @list); + $reply .= "): " . join(" \002;;\002 ", @list) ."."; last if (length($reply) < $maxlen and scalar(@list) <= $maxshow); last if (scalar(@list) == 1);