From 1b4aec7bda2ccd45dbf1c18ae6585dfe185bdf48 Mon Sep 17 00:00:00 2001 From: Adam- Date: Sun, 30 Aug 2009 20:46:07 +0000 Subject: Add messages at the bottom of HELP telling you if you can/cant use the command and why, and what permission is required if there is one git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2487 5417fbe8-f217-4b02-8779-1006273d7864 --- src/commands.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/commands.c b/src/commands.c index a564b644e..a3ba87e1c 100644 --- a/src/commands.c +++ b/src/commands.c @@ -199,6 +199,24 @@ void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[], const char if (!c || !c->OnHelp(u, subcommand)) notice_lang(service, u, NO_HELP_AVAILABLE, cmd); + else + { + u->SendMessage(service, " "); + + /* Inform the user what permission is required to use the command */ + if (!c->permission.empty()) + notice_lang(service, u, COMMAND_REQUIRES_PERM, c->permission.c_str()); + + /* User isn't identified and needs to be to use this command */ + if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !nick_identified(u)) + notice_lang(service, u, COMMAND_IDENTIFY_REQUIRED); + /* User doesn't have the proper permission to use this command */ + else if (!c->permission.empty() && (!u->nc || (!u->nc->HasCommand(c->permission)))) + notice_lang(service, u, COMMAND_CANNOT_USE); + /* User can use this command */ + else + notice_lang(service, u, COMMAND_CAN_USE); + } } /*************************************************************************/ -- cgit