From: dms Date: Fri, 2 Feb 2001 14:03:03 +0000 (+0000) Subject: compress config params as muc has possible per line X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9f31b4af022ce0b0d718c126c55523efe89098b4;p=infobot.git compress config params as muc has possible per line git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@310 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Modules/UserDCC.pl b/src/Modules/UserDCC.pl index be2373c..6967881 100644 --- a/src/Modules/UserDCC.pl +++ b/src/Modules/UserDCC.pl @@ -499,6 +499,7 @@ sub userDCC { } my $update = 0; + ### TODO: $what can be undefined. fix it! if ($what =~ /^\+(\S+)/) { my $was = $chanconf{$chan}{$1}; $was = ($was) ? "; was '$was'" : ""; @@ -543,8 +544,16 @@ sub userDCC { foreach $chan ($chan, "_default") { &pSReply("chan: $chan"); ### TODO: merge 2 or 3 per line. + my @items; + my $str = ""; foreach (sort keys %{ $chanconf{$chan} }) { - &pSReply(" $_ => $chanconf{$chan}{$_}"); + my $newstr = join(', ', @items); + if (length $newstr > 60) { + &pSReply(" $str"); + @items = (); + } + $str = $newstr; + push(@items, "$_ => $chanconf{$chan}{$_}"); } }