summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-23 04:29:25 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-23 04:29:25 +0000
commitce09914e1d767e88f6f5d72ac622d1321c91f9ee (patch)
treec8849a22d6843e562977f45126d525ea6ae07f73 /src/core
parent656cc9973e5fbedf1ad25951c9fe80cbaa2fb3bb (diff)
Fix part #2 of bug #1010, patched partially by Adam and cleaned up / finished by me, the help commands should work as expected now, including "help set ..." and similar help entries.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2194 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bs_kick.c7
-rw-r--r--src/core/bs_set.c16
-rw-r--r--src/core/cs_help.c39
-rw-r--r--src/core/cs_set.c12
-rw-r--r--src/core/ms_set.c2
-rw-r--r--src/core/ns_help.c1
-rw-r--r--src/core/ns_saset.c2
-rw-r--r--src/core/ns_set.c8
-rw-r--r--src/core/os_set.c2
9 files changed, 49 insertions, 40 deletions
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c
index 525a6da23..2e5d1d724 100644
--- a/src/core/bs_kick.c
+++ b/src/core/bs_kick.c
@@ -315,7 +315,9 @@ class CommandBSKick : public Command
bool OnHelp(User *u, const std::string &subcommand)
{
- if (subcommand == "BADWORDS")
+ if (subcommand.empty())
+ notice_help(s_BotServ, u, BOT_HELP_KICK);
+ else if (subcommand == "BADWORDS")
notice_help(s_BotServ, u, BOT_HELP_KICK_BADWORDS);
else if (subcommand == "BOLDS")
notice_help(s_BotServ, u, BOT_HELP_KICK_BOLDS);
@@ -332,7 +334,8 @@ class CommandBSKick : public Command
else if (subcommand == "UNDERLINES")
notice_help(s_BotServ, u, BOT_HELP_KICK_UNDERLINES);
else
- notice_help(s_BotServ, u, BOT_HELP_KICK);
+ return false;
+
return true;
}
diff --git a/src/core/bs_set.c b/src/core/bs_set.c
index b03b622b1..d8bf4c03b 100644
--- a/src/core/bs_set.c
+++ b/src/core/bs_set.c
@@ -150,7 +150,13 @@ class CommandBSSet : public Command
bool OnHelp(User *u, const std::string &subcommand)
{
- if (subcommand == "DONTKICKOPS")
+ if (subcommand.empty())
+ {
+ notice_help(s_BotServ, u, BOT_HELP_SET);
+ if (is_services_admin(u))
+ notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_SET);
+ }
+ else if (subcommand == "DONTKICKOPS")
notice_help(s_BotServ, u, BOT_HELP_SET_DONTKICKOPS);
else if (subcommand == "DONTKICKVOICES")
notice_help(s_BotServ, u, BOT_HELP_SET_DONTKICKVOICES);
@@ -164,12 +170,8 @@ class CommandBSSet : public Command
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_NOBOT);
else if (subcommand == "PRIVATE")
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_PRIVATE);
- else if (subcommand.empty())
- {
- notice_help(s_BotServ, u, BOT_HELP_SET);
- if (is_services_admin(u) || is_services_root(u))
- notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_SET);
- }
+ else
+ return false;
return true;
}
diff --git a/src/core/cs_help.c b/src/core/cs_help.c
index 17ec5fe4c..173fe1a7f 100644
--- a/src/core/cs_help.c
+++ b/src/core/cs_help.c
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
+ * Based on the original code of Services by Andy Church.
+ *
* $Id$
*
*/
@@ -18,29 +18,21 @@
class CommandCSHelp : public Command
{
public:
- CommandCSHelp() : Command("HELP", 0, 2)
+ CommandCSHelp() : Command("HELP", 1, 1)
{
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
- const char *cmd = params.size() > 0 ? params[0].c_str() : NULL;
+ const char *cmd = params[0].c_str();
- if (!cmd)
- {
- notice_help(s_ChanServ, u, CHAN_HELP);
- moduleDisplayHelp(2, u);
- if (CSExpire >= 86400)
- notice_help(s_ChanServ, u, CHAN_HELP_EXPIRES, CSExpire / 86400);
- if (is_services_oper(u))
- notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP);
- }
- else if (stricmp(cmd, "LEVELS DESC") == 0)
+ if (!stricmp(cmd, "LEVELS DESC"))
{
int i;
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC);
- if (!levelinfo_maxwidth) {
+ if (!levelinfo_maxwidth)
+ {
for (i = 0; levelinfo[i].what >= 0; i++)
{
int len = strlen(levelinfo[i].name);
@@ -50,17 +42,24 @@ class CommandCSHelp : public Command
}
for (i = 0; levelinfo[i].what >= 0; i++)
{
- notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT,
- levelinfo_maxwidth, levelinfo[i].name,
- getstring(u, levelinfo[i].desc));
+ notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name, getstring(u, levelinfo[i].desc));
}
}
else
- {
mod_help_cmd(s_ChanServ, u, CHANSERV, cmd);
- }
+
return MOD_CONT;
}
+
+ void OnSyntaxError(User *u)
+ {
+ notice_help(s_ChanServ, u, CHAN_HELP);
+ moduleDisplayHelp(2, u);
+ if (CSExpire >= 86400)
+ notice_help(s_ChanServ, u, CHAN_HELP_EXPIRES, CSExpire / 86400);
+ if (is_services_oper(u))
+ notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP);
+ }
};
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 76ec975b8..63a2bfb36 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -668,14 +668,9 @@ class CommandCSSet : public Command
{
if (subcommand.empty())
{
- if (is_services_admin(u) || is_services_root(u))
- {
+ notice_help(s_ChanServ, u, CHAN_HELP_SET);
+ if (is_services_admin(u))
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_SET);
- }
- else
- {
- notice_help(s_ChanServ, u, CHAN_HELP_SET);
- }
}
else if (subcommand == "FOUNDER")
notice_help(s_ChanServ, u, CHAN_HELP_SET_FOUNDER);
@@ -719,6 +714,9 @@ class CommandCSSet : public Command
notice_help(s_ChanServ, u, CHAN_HELP_SET_PEACE);
else if (subcommand == "NOEXPIRE")
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_SET_NOEXPIRE);
+ else
+ return false;
+
return true;
}
diff --git a/src/core/ms_set.c b/src/core/ms_set.c
index 64d897187..aa8d33453 100644
--- a/src/core/ms_set.c
+++ b/src/core/ms_set.c
@@ -249,6 +249,8 @@ class CommandMSSet : public Command
else
notice_help(s_MemoServ, u, MEMO_HELP_SET_LIMIT, MSMaxMemos);
}
+ else
+ return false;
return true;
}
diff --git a/src/core/ns_help.c b/src/core/ns_help.c
index 6b335bd24..061293824 100644
--- a/src/core/ns_help.c
+++ b/src/core/ns_help.c
@@ -26,6 +26,7 @@ class CommandNSHelp : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
const char *cmd = params[0].c_str();
+
if (!stricmp(cmd, "SET LANGUAGE"))
{
int i;
diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c
index 185bb592d..f4cae7c07 100644
--- a/src/core/ns_saset.c
+++ b/src/core/ns_saset.c
@@ -569,6 +569,8 @@ public:
notice_help(s_NickServ, u, NICK_HELP_SASET_AUTOOP);
else if (subcommand == "LANGUAGE")
notice_help(s_NickServ, u, NICK_HELP_SASET_LANGUAGE);
+ else
+ return false;
return true;
}
diff --git a/src/core/ns_set.c b/src/core/ns_set.c
index 9e00c0267..d99c657eb 100644
--- a/src/core/ns_set.c
+++ b/src/core/ns_set.c
@@ -463,8 +463,6 @@ class CommandNSSet : public Command
*/
if (u->nc->flags & NI_SUSPENDED)
notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nc->display);
- else if (!nick_identified(u))
- notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
else if (!stricmp(cmd, "DISPLAY"))
return this->DoSetDisplay(u, params, u->nc);
else if (!stricmp(cmd, "PASSWORD"))
@@ -498,7 +496,9 @@ class CommandNSSet : public Command
bool OnHelp(User *u, const std::string &subcommand)
{
- if (subcommand == "DISPLAY")
+ if (subcommand.empty())
+ notice_help(s_NickServ, u, NICK_HELP_SET);
+ else if (subcommand == "DISPLAY")
notice_help(s_NickServ, u, NICK_HELP_SET_DISPLAY);
else if (subcommand == "PASSWORD")
notice_help(s_NickServ, u, NICK_HELP_SET_PASSWORD);
@@ -523,7 +523,7 @@ class CommandNSSet : public Command
else if (subcommand == "AUTOOP")
notice_help(s_NickServ, u, NICK_HELP_SET_AUTOOP);
else
- notice_help(s_NickServ, u, NICK_HELP_SET);
+ return false;
return true;
}
diff --git a/src/core/os_set.c b/src/core/os_set.c
index 1d4ed8523..362db0194 100644
--- a/src/core/os_set.c
+++ b/src/core/os_set.c
@@ -283,6 +283,8 @@ class CommandOSSet : public Command
notice_help(s_OperServ, u, OPER_HELP_SET_IGNORE);
else if (subcommand == "SUPERADMIN")
notice_help(s_OperServ, u, OPER_HELP_SET_SUPERADMIN);
+ else
+ return false;
return true;
}