]> git.donarmstrong.com Git - infobot.git/commitdiff
chanset zero handling
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Jan 2006 09:27:31 +0000 (09:27 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Jan 2006 09:27:31 +0000 (09:27 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1254 c11ca15a-4712-0410-83d8-924469b57eb5

src/DynaConfig.pl

index ea94e5b0a566f44a0d2d72b7cc7b26e4f5ad56a4..f4ba9c3f207fd3d489a62a3672921fa5b480e471 100644 (file)
@@ -718,10 +718,10 @@ sub chanSet {
        ### ".chanset +blah"
        ### ".chanset +blah 10"         -- error.
 
-       my $state       = ($1 eq "+") ? 1 : 0;
+       my $set = ($1 eq "+") ? 1 : 0;
        my $was         = $chanconf{$chan}{$what};
 
-       if ($state) {                   # add/set.
+       if ($set) {                     # add/set.
            if (defined $was and $was eq "1") {
                &performStrictReply("setting $what for $chan already 1.");
                return;
@@ -735,16 +735,11 @@ sub chanSet {
                return;
            }
 
-           if ($was eq "0") {
-               &performStrictReply("setting $what for $chan already 0.");
-               return;
-           }
-
            $val        = 0;
        }
 
        # alter for cosmetic (print out) reasons only.
-       $was    = ($was) ? "; was '$was'" : "";
+       $was    = (defined $was) ? "; was '$was'" : "";
 
        if ($val eq "0") {
            &performStrictReply("Unsetting $what for $chan$was.");