]> git.donarmstrong.com Git - infobot.git/blobdiff - src/DynaConfig.pl
chanset: fixed the following problem.
[infobot.git] / src / DynaConfig.pl
index d121937995b8280e1f10f5c9f1de2b3ac30cf895..926daf4b00f21b76b38457d4730e5490c1cb5837 100644 (file)
@@ -712,8 +712,14 @@ sub chanSet {
            $val        = 0;
        }
 
-       $chanconf{$chan}{$what} = $val;
-       &pSReply("Setting $what for $chan to '$val'$was.");
+       if ($val eq "0") {
+           &pSReply("Unsetting $what for $chan$was.");
+           delete $chanconf{$chan}{$what};
+       } else {
+           &pSReply("Setting $what for $chan to '$val'$was.");
+           $chanconf{$chan}{$what}     = $val;
+       }
+
        $update++;
 
     ### ".chanset blah testing"