Bug fix: Commands getting Permission denied even with incorrect prefix.

This commit is contained in:
Elijah Perrault committed 2011-02-15 22:09:11 -07:00
1 parent 187de7cdef
commit c0aa9d981c
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ In this alpha4 release, we have added:
Bug fixes:
None
* Commands getting Permission denied even with incorrect prefix.
Incompatibilities:
+1
View File
@@ -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.
+2 -2
View File
@@ -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.