diff options
author | Adam <Adam@anope.org> | 2014-08-03 19:08:12 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-08-03 19:08:12 -0400 |
commit | 8210e82a5ea02232e649a3f1c5f27214c655c5b6 (patch) | |
tree | d52413c2d506f38121b26e4185ebb8e5146da323 /modules/commands/ns_set.cpp | |
parent | d6d72cd803b2c5bf38e152dc6d00dd6dda720951 (diff) |
Fix some botserv help entries from showing when they shouldn't
Diffstat (limited to 'modules/commands/ns_set.cpp')
-rw-r--r-- | modules/commands/ns_set.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index f4ecd044b..03ebae85c 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -33,7 +33,8 @@ class CommandNSSet : public Command source.Reply(_("Sets various nickname options. \037option\037 can be one of:")); Anope::string this_name = source.command; - 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"); for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it) { const Anope::string &c_name = it->first; @@ -42,13 +43,12 @@ class CommandNSSet : public Command if (c_name.find_ci(this_name + " ") == 0) { ServiceReference<Command> c("Command", info.name); + // XXX dup if (!c) continue; - else if (!hide_privileged_commands) - ; // Always show with hide_privileged_commands disabled - else if (!c->AllowUnregistered() && !source.GetAccount()) + else if (hide_registered_commands && !c->AllowUnregistered() && !source.GetAccount()) continue; - else if (!info.permission.empty() && !source.HasCommand(info.permission)) + else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) continue; source.command = c_name; |