summaryrefslogtreecommitdiff
path: root/modules/commands/bs_set.cpp
diff options
context:
space:
mode:
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);
}