]> git.donarmstrong.com Git - infobot.git/commitdiff
lc chans on chanset
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Sep 2003 22:18:13 +0000 (22:18 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Sep 2003 22:18:13 +0000 (22:18 +0000)
report -values as 0, not NOT-SET
longer lines on chanset <chan>
don't auto-include _default (avoid flood-kicks)

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@828 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/UserDCC.pl

index 02a68074ef797185300e694123fd6ba34c776589..e79399b0257bd86746135b9e6e721bb5ea95f039 100644 (file)
@@ -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 = ();
                    }