diff --git a/NEWS b/NEWS index f4c8139..3c1fd8e 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ In this alpha4 release, we have added: Bug fixes: -None +* Commands getting Permission denied even with incorrect prefix. Incompatibilities: diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 785bdd4..2d6991d 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Bug fix: Commands getting Permission denied even with incorrect prefix. * Changed command callback arguments to: \%src, @args * Bundle server with \%src in the on_rcjoin event. * logchan is now joined automatically. diff --git a/lib/Parser/IRC.pm b/lib/Parser/IRC.pm index a07ff61..92bc607 100644 --- a/lib/Parser/IRC.pm +++ b/lib/Parser/IRC.pm @@ -587,7 +587,7 @@ sub privmsg $cprefix = (conf_get("fantasy_pf"))[0][0]; $rprefix = substr($ex[3], 1, 1); $cmd = uc(substr($ex[3], 2)); - if (defined $API::Std::CMDS{$cmd}) { + if (defined $API::Std::CMDS{$cmd} and $rprefix eq $cprefix) { # If this is indeed a command, continue. if ($API::Std::CMDS{$cmd}{lvl} == 0 or $API::Std::CMDS{$cmd}{lvl} == 2) { # Ensure the level is public or all. @@ -597,7 +597,7 @@ sub privmsg # If this command takes a privilege... if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) { # Make sure they have it. - &{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv) if $rprefix eq $cprefix; + &{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv); } else { # Else give them the boot.