]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/UserDCC.pl
speak english much?
[infobot.git] / src / Modules / UserDCC.pl
index f8ac484c71aa17d53cfed8c863ad205bfa43ba9f..ab2b08bf97aed823d2b7e5e284fd2fc137407ae5 100644 (file)
@@ -339,9 +339,9 @@ sub userDCC {
        &DEBUG("chan => '$1', msg => '$msg'.");
 
        if (&validChan($chan)) {
-           &msg($chan, $2);
+           &msg($chan, $msg);
        } else {
-           &msg($who,"i'm not on \002$1\002, sorry.");
+           &msg($who,"i'm not on \002$chan\002, sorry.");
        }
        return;
     }
@@ -480,7 +480,7 @@ sub userDCC {
        &DEBUG("after joinnextchan");
 
        &status("USER reset $who");
-       &msg($who,"resetted");
+       &msg($who,"reset complete");
 
        return;
     }
@@ -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 = ();
                    }
@@ -1184,7 +1189,7 @@ sub userDCC {
 
        if (!$state) {                  # delignore.
            if ( &ignoreDel($mask) ) {
-               &pSReply("ok, deleted X ignores.");
+               &pSReply("ok, deleted ignores for $mask.");
            } else {
                &pSReply("could not find $mask in ignore list.");
            }
@@ -1204,7 +1209,7 @@ sub userDCC {
 
        # time.
        if ($args =~ s/^(\d+)\s*//) {
-           $time = $1*60;      # ??
+           $time = $1; # time is in minutes
        } else {
            $time = 0;
        }