summaryrefslogtreecommitdiff
path: root/modules/commands/bs_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-08-03 19:08:12 -0400
committerAdam <Adam@anope.org>2014-08-03 19:08:12 -0400
commit8210e82a5ea02232e649a3f1c5f27214c655c5b6 (patch)
treed52413c2d506f38121b26e4185ebb8e5146da323 /modules/commands/bs_set.cpp
parentd6d72cd803b2c5bf38e152dc6d00dd6dda720951 (diff)
Fix some botserv help entries from showing when they shouldn't
Diffstat (limited to 'modules/commands/bs_set.cpp')
-rw-r--r--modules/commands/bs_set.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp
index 819ac42b3..cbe6adbe0 100644
--- a/modules/commands/bs_set.cpp
+++ b/modules/commands/bs_set.cpp
@@ -32,6 +32,8 @@ class CommandBSSet : public Command
source.Reply(_("Configures bot options.\n"
" \n"
"Available options:"));
+ bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
+ hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands");
Anope::string this_name = source.command;
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
{
@@ -42,6 +44,13 @@ class CommandBSSet : public Command
ServiceReference<Command> command("Command", info.name);
if (command)
{
+ // XXX dup
+ if (hide_registered_commands && !command->AllowUnregistered() && !source.GetAccount())
+ continue;
+
+ if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
+ continue;
+
source.command = it->first;
command->OnServHelp(source);
}