From 2b1723b46131b1aa4fe12c0adbdc4615336e18cd Mon Sep 17 00:00:00 2001 From: timriker Date: Fri, 6 Jan 2006 09:27:31 +0000 Subject: [PATCH] chanset zero handling git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1254 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/DynaConfig.pl | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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."); -- 2.39.5