From: timriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Fri, 6 Jan 2006 09:27:31 +0000 (+0000)
Subject: chanset zero handling
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2b1723b46131b1aa4fe12c0adbdc4615336e18cd;p=infobot.git

chanset zero handling


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

diff --git a/src/DynaConfig.pl b/src/DynaConfig.pl
index ea94e5b..f4ba9c3 100644
--- a/src/DynaConfig.pl
+++ b/src/DynaConfig.pl
@@ -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.");