From: timriker Date: Fri, 6 Jan 2006 09:27:31 +0000 (+0000) Subject: chanset zero handling X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=ffdaf01058c45ed38e737907e1412802cee8a648 chanset zero handling git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1254 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/DynaConfig.pl b/blootbot/src/DynaConfig.pl index ea94e5b..f4ba9c3 100644 --- a/blootbot/src/DynaConfig.pl +++ b/blootbot/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.");