]> git.donarmstrong.com Git - infobot.git/commitdiff
compress config params as muc has possible per line
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 2 Feb 2001 14:03:03 +0000 (14:03 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 2 Feb 2001 14:03:03 +0000 (14:03 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@310 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/UserDCC.pl

index be2373ccb015a40a29a6bc3ae8a107774f4f6c2e..6967881d03f964be5b488d866ac1daf2e81f3bf8 100644 (file)
@@ -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}{$_}");
                }
            }