]> git.donarmstrong.com Git - infobot.git/commitdiff
shorter lists
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 1 Jul 2004 17:52:39 +0000 (17:52 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 1 Jul 2004 17:52:39 +0000 (17:52 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@978 c11ca15a-4712-0410-83d8-924469b57eb5

src/Misc.pl

index 9b6240aa1aca829ee03c666ce3ad8038be7f3a73..843cbb59039b8463447df738c60e6526b626c934 100644 (file)
@@ -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);