Bug fix: Commands getting Permission denied even with incorrect prefix.
This commit is contained in:
1 parent
187de7cdef
commit
c0aa9d981c
3 files changed
+4
-3
No files matched your search
@@ -21,7 +21,7 @@ In this alpha4 release, we have added:
|
|||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
None
|
* Commands getting Permission denied even with incorrect prefix.
|
||||||
|
|
||||||
Incompatibilities:
|
Incompatibilities:
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
* Bug fix: Commands getting Permission denied even with incorrect prefix.
|
||||||
* Changed command callback arguments to: \%src, @args
|
* Changed command callback arguments to: \%src, @args
|
||||||
* Bundle server with \%src in the on_rcjoin event.
|
* Bundle server with \%src in the on_rcjoin event.
|
||||||
* logchan is now joined automatically.
|
* logchan is now joined automatically.
|
||||||
|
|||||||
+2
-2
@@ -587,7 +587,7 @@ sub privmsg
|
|||||||
$cprefix = (conf_get("fantasy_pf"))[0][0];
|
$cprefix = (conf_get("fantasy_pf"))[0][0];
|
||||||
$rprefix = substr($ex[3], 1, 1);
|
$rprefix = substr($ex[3], 1, 1);
|
||||||
$cmd = uc(substr($ex[3], 2));
|
$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 this is indeed a command, continue.
|
||||||
if ($API::Std::CMDS{$cmd}{lvl} == 0 or $API::Std::CMDS{$cmd}{lvl} == 2) {
|
if ($API::Std::CMDS{$cmd}{lvl} == 0 or $API::Std::CMDS{$cmd}{lvl} == 2) {
|
||||||
# Ensure the level is public or all.
|
# Ensure the level is public or all.
|
||||||
@@ -597,7 +597,7 @@ sub privmsg
|
|||||||
# If this command takes a privilege...
|
# If this command takes a privilege...
|
||||||
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
||||||
# Make sure they have it.
|
# 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 {
|
||||||
# Else give them the boot.
|
# Else give them the boot.
|
||||||
|
|||||||
Reference in new issue
Block a user