summaryrefslogtreecommitdiff
path: root/modules/commands/help.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-15 15:10:23 -0500
committerAdam <Adam@anope.org>2013-11-15 15:10:23 -0500
commit332fd239278fe1a80c500a1ea01763e84783057c (patch)
treefc270afbd4a36fdd673119f85c8b63edcad38579 /modules/commands/help.cpp
parent1aca2922afe8883b2c65dd5c500758b12197e00c (diff)
Add general:hideregisteredcommands to hide commands that require you to be identified to use. This changes the behavior of hideprivilegedcommands to only hide commands users don't have the oper privileges to execute.
Diffstat (limited to 'modules/commands/help.cpp')
-rw-r--r--modules/commands/help.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp
index ac8c98b09..8d9cce46d 100644
--- a/modules/commands/help.cpp
+++ b/modules/commands/help.cpp
@@ -44,7 +44,8 @@ class CommandHelp : public Command
Anope::string source_command = source.command;
const BotInfo *bi = source.service;
const CommandInfo::map &map = source.c ? Config->Fantasy : bi->commands;
- bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands");
+ bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
+ hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands");
if (params.empty() || params[0].equals_ci("ALL"))
{
@@ -72,11 +73,11 @@ class CommandHelp : public Command
ServiceReference<Command> c("Command", info.name);
if (!c)
continue;
- else if (!hide_privileged_commands)
- ; // Always show with hide_privileged_commands disabled
- else if (!c->AllowUnregistered() && !source.GetAccount())
+
+ if (hide_registered_commands && !c->AllowUnregistered() && !source.GetAccount())
continue;
- else if (!info.permission.empty() && !source.HasCommand(info.permission))
+
+ if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
continue;
if (!info.group.empty() && !all)
@@ -145,9 +146,8 @@ class CommandHelp : public Command
ServiceReference<Command> c("Command", info.name);
if (!c)
continue;
- else if (!hide_privileged_commands)
- ; // Always show with hide_privileged_commands disabled
- else if (!info.permission.empty() && !source.HasCommand(info.permission))
+
+ if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
continue;
// Allow unregistered users to see help for commands that they explicitly request help for