From 2748d9616d0f64329de347f947cf5c8301f5ddcb Mon Sep 17 00:00:00 2001 From: timriker Date: Thu, 1 Jul 2004 17:52:39 +0000 Subject: [PATCH] shorter lists git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@978 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Misc.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Misc.pl b/src/Misc.pl index 9b6240a..843cbb5 100644 --- a/src/Misc.pl +++ b/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); -- 2.39.5