From: timriker Date: Thu, 4 Sep 2003 22:18:13 +0000 (+0000) Subject: lc chans on chanset X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=59af7ce301b16ef31e81bbd97551ada7f57b8934;p=infobot.git lc chans on chanset report -values as 0, not NOT-SET longer lines on chanset don't auto-include _default (avoid flood-kicks) git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@828 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Modules/UserDCC.pl b/blootbot/src/Modules/UserDCC.pl index 02a6807..e79399b 100644 --- a/blootbot/src/Modules/UserDCC.pl +++ b/blootbot/src/Modules/UserDCC.pl @@ -536,7 +536,7 @@ sub userDCC { my @chans; while ($args =~ s/^($mask{chan})\s*//) { - push(@chans, $1); + push(@chans, lc($1)); } if (!scalar @chans) { @@ -555,7 +555,12 @@ sub userDCC { my %vals; foreach (keys %chanconf) { - my $val = $chanconf{$_}{$what} || "NOT-SET"; + my $val; + if (defined $chanconf{$_}{$what}) { + $val = $chanconf{$_}{$what}; + } else { + $val = "NOT-SET"; + } $vals{$val}{$_} = 1; } @@ -572,14 +577,14 @@ sub userDCC { if ($cmd eq "chanset" and !defined $what) { &DEBUG("showing channel conf."); - foreach $chan ($chan, "_default") { - &pSReply("chan: $chan"); - ### TODO: merge 2 or 3 per line. + foreach $chan (@chans) { + &pSReply("chan: $chan (will also use _default)"); my @items; my $str = ""; foreach (sort keys %{ $chanconf{$chan} }) { my $newstr = join(', ', @items); - if (length $newstr > 63) { + ### TODO: make length use channel line limit? + if (length $newstr > 400) { &pSReply(" $str"); @items = (); }