From 46999217c3d054503f0ede2b2283aaa0de6d9480 Mon Sep 17 00:00:00 2001
From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Fri, 2 Feb 2001 14:03:03 +0000
Subject: [PATCH] compress config params as muc has possible per line

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@310 c11ca15a-4712-0410-83d8-924469b57eb5
---
 blootbot/src/Modules/UserDCC.pl | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/blootbot/src/Modules/UserDCC.pl b/blootbot/src/Modules/UserDCC.pl
index be2373c..6967881 100644
--- a/blootbot/src/Modules/UserDCC.pl
+++ b/blootbot/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}{$_}");
 		}
 	    }
 
-- 
2.39.5