summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h3
-rw-r--r--src/command.cpp2
-rw-r--r--src/commands.c6
-rw-r--r--src/core/bs_act.c2
-rw-r--r--src/core/bs_assign.c2
-rw-r--r--src/core/bs_badwords.c7
-rw-r--r--src/core/bs_bot.c26
-rw-r--r--src/core/bs_help.c2
-rw-r--r--src/core/bs_info.c2
-rw-r--r--src/core/bs_kick.c2
-rw-r--r--src/core/bs_say.c4
-rw-r--r--src/core/bs_set.c2
-rw-r--r--src/core/bs_unassign.c2
-rw-r--r--src/core/cs_access.c14
-rw-r--r--src/core/cs_akick.c6
-rw-r--r--src/core/cs_ban.c4
-rw-r--r--src/core/cs_clear.c2
-rw-r--r--src/core/cs_drop.c2
-rw-r--r--src/core/cs_forbid.c2
-rw-r--r--src/core/cs_getkey.c2
-rw-r--r--src/core/cs_help.c2
-rw-r--r--src/core/cs_info.c2
-rw-r--r--src/core/cs_invite.c2
-rw-r--r--src/core/cs_kick.c2
-rw-r--r--src/core/cs_list.c2
-rw-r--r--src/core/cs_modes.c20
-rw-r--r--src/core/cs_register.c2
-rw-r--r--src/core/cs_set.c76
-rw-r--r--src/core/cs_status.c2
-rw-r--r--src/core/cs_suspend.c6
-rw-r--r--src/core/cs_topic.c2
-rw-r--r--src/core/cs_xop.c18
-rw-r--r--src/core/hs_del.c2
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_help.c2
-rw-r--r--src/core/hs_set.c2
-rw-r--r--src/core/hs_setall.c2
-rw-r--r--src/core/ms_cancel.c2
-rw-r--r--src/core/ms_check.c2
-rw-r--r--src/core/ms_del.c4
-rw-r--r--src/core/ms_help.c2
-rw-r--r--src/core/ms_list.c4
-rw-r--r--src/core/ms_read.c4
-rw-r--r--src/core/ms_rsend.c2
-rw-r--r--src/core/ms_send.c2
-rw-r--r--src/core/ms_sendall.c2
-rw-r--r--src/core/ms_set.c2
-rw-r--r--src/core/ms_staff.c2
-rw-r--r--src/core/ns_access.c8
-rw-r--r--src/core/ns_forbid.c4
-rw-r--r--src/core/ns_getemail.c2
-rw-r--r--src/core/ns_getpass.c2
-rw-r--r--src/core/ns_ghost.c2
-rw-r--r--src/core/ns_group.c2
-rw-r--r--src/core/ns_help.c2
-rw-r--r--src/core/ns_identify.c2
-rw-r--r--src/core/ns_info.c2
-rw-r--r--src/core/ns_list.c2
-rw-r--r--src/core/ns_logout.c4
-rw-r--r--src/core/ns_recover.c2
-rw-r--r--src/core/ns_register.c4
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/core/ns_saset.c20
-rw-r--r--src/core/ns_sendpass.c2
-rw-r--r--src/core/ns_set.c20
-rw-r--r--src/core/ns_suspend.c4
-rw-r--r--src/core/os_akill.c10
-rw-r--r--src/core/os_chankill.c4
-rw-r--r--src/core/os_clearmodes.c4
-rw-r--r--src/core/os_defcon.c4
-rw-r--r--src/core/os_global.c2
-rw-r--r--src/core/os_help.c2
-rw-r--r--src/core/os_ignore.c8
-rw-r--r--src/core/os_jupe.c2
-rw-r--r--src/core/os_kick.c2
-rw-r--r--src/core/os_mode.c2
-rw-r--r--src/core/os_modinfo.c2
-rw-r--r--src/core/os_modload.c2
-rw-r--r--src/core/os_modunload.c2
-rw-r--r--src/core/os_news.c14
-rw-r--r--src/core/os_noop.c4
-rw-r--r--src/core/os_oline.c4
-rw-r--r--src/core/os_session.c18
-rw-r--r--src/core/os_set.c14
-rw-r--r--src/core/os_sgline.c12
-rw-r--r--src/core/os_sqline.c10
-rw-r--r--src/core/os_svsnick.c2
-rw-r--r--src/core/os_szline.c10
-rw-r--r--src/core/os_umode.c4
-rw-r--r--src/modules/cs_appendtopic.c2
-rw-r--r--src/modules/cs_enforce.c4
-rw-r--r--src/modules/cs_tban.c4
-rw-r--r--src/modules/hs_request.c8
-rw-r--r--src/modules/os_info.c13
94 files changed, 276 insertions, 247 deletions
diff --git a/include/modules.h b/include/modules.h
index 47e4483d1..8543b0199 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -260,8 +260,9 @@ class CoreExport Command : public Flags<CommandFlag>
/** Requested when the user provides bad syntax to this command (not enough params, etc).
* @param u The user executing the command.
+ * @param subcommand The subcommand the user tried to use
*/
- virtual void OnSyntaxError(User *u);
+ virtual void OnSyntaxError(User *u, const ci::string &subcommand);
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
* @param reststr The permission required to successfully execute this command
diff --git a/src/command.cpp b/src/command.cpp
index 41e9045e5..89318776b 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -33,7 +33,7 @@ CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_
bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; }
-void Command::OnSyntaxError(User *u) { }
+void Command::OnSyntaxError(User *u, const ci::string &subcommand) { }
void Command::SetPermission(const std::string &reststr)
{
diff --git a/src/commands.c b/src/commands.c
index d8fcf5589..0e548a22d 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -76,10 +76,6 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
return;
}
}
- else
- {
- // Check whether or not access string is empty
- }
std::vector<ci::string> params;
std::string curparam;
@@ -109,7 +105,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
if (params.size() < c->MinParams)
{
- c->OnSyntaxError(u);
+ c->OnSyntaxError(u, params.size() > 1 ? params[1].c_str() : "");
return;
}
diff --git a/src/core/bs_act.c b/src/core/bs_act.c
index 96d7e3c93..0fea7e929 100644
--- a/src/core/bs_act.c
+++ b/src/core/bs_act.c
@@ -55,7 +55,7 @@ class CommandBSAct : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "ACT", BOT_ACT_SYNTAX);
}
diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c
index d710cb11e..82542580e 100644
--- a/src/core/bs_assign.c
+++ b/src/core/bs_assign.c
@@ -72,7 +72,7 @@ class CommandBSAssign : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX);
}
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index bef4a7dad..fc9c10bcd 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -244,7 +244,7 @@ class CommandBSBadwords : public Command
if (need_args ? 0 : !word)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, cmd);
return MOD_CONT;
}
@@ -271,7 +271,8 @@ class CommandBSBadwords : public Command
else if (cmd == "CLEAR")
return this->DoClear(u, ci, word);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
+
return MOD_CONT;
}
@@ -281,7 +282,7 @@ class CommandBSBadwords : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX);
}
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c
index e6a6e59e8..955f4e42c 100644
--- a/src/core/bs_bot.c
+++ b/src/core/bs_bot.c
@@ -21,18 +21,12 @@ class CommandBSBot : public Command
CommandReturn DoAdd(User *u, std::vector<ci::string> &params)
{
const char *nick = params[1].c_str();
- const char *user = params.size() > 2 ? params[2].c_str() : NULL;
- const char *host = params.size() > 3 ? params[3].c_str() : NULL;
- const char *real = params.size() > 4 ? params[4].c_str() : NULL;
+ const char *user = params[2].c_str();
+ const char *host = params[3].c_str();
+ const char *real = params[4].c_str();
const char *ch = NULL;
BotInfo *bi;
- if (!nick || !user || !host || !real)
- {
- this->OnSyntaxError(u);
- return MOD_CONT;
- }
-
if (findbot(nick))
{
notice_lang(s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick);
@@ -135,7 +129,7 @@ class CommandBSBot : public Command
if (!oldnick || !nick)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "CHANGE");
return MOD_CONT;
}
@@ -310,7 +304,7 @@ class CommandBSBot : public Command
if (!nick)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -362,7 +356,7 @@ class CommandBSBot : public Command
if (params.size() < 5)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -384,7 +378,7 @@ class CommandBSBot : public Command
if (params.size() < 3)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "CHANGE");
return MOD_CONT;
}
@@ -401,14 +395,14 @@ class CommandBSBot : public Command
if (params.size() < 1)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
return this->DoDel(u, params);
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -419,7 +413,7 @@ class CommandBSBot : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
}
diff --git a/src/core/bs_help.c b/src/core/bs_help.c
index ae0e73fdf..05fbc9f8d 100644
--- a/src/core/bs_help.c
+++ b/src/core/bs_help.c
@@ -30,7 +30,7 @@ class CommandBSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
// Abuse syntax error to display general list help.
notice_help(s_BotServ, u, BOT_HELP);
diff --git a/src/core/bs_info.c b/src/core/bs_info.c
index eb438e572..86daebbd2 100644
--- a/src/core/bs_info.c
+++ b/src/core/bs_info.c
@@ -238,7 +238,7 @@ class CommandBSInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "INFO", BOT_INFO_SYNTAX);
}
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c
index c1294c9c2..7f9ee8b7b 100644
--- a/src/core/bs_kick.c
+++ b/src/core/bs_kick.c
@@ -342,7 +342,7 @@ class CommandBSKick : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
}
diff --git a/src/core/bs_say.c b/src/core/bs_say.c
index f0f8c8454..2a1752c05 100644
--- a/src/core/bs_say.c
+++ b/src/core/bs_say.c
@@ -51,7 +51,7 @@ class CommandBSSay : public Command
if (text[0] == '\001')
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -68,7 +68,7 @@ class CommandBSSay : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "SAY", BOT_SAY_SYNTAX);
}
diff --git a/src/core/bs_set.c b/src/core/bs_set.c
index ec569c205..34dbda165 100644
--- a/src/core/bs_set.c
+++ b/src/core/bs_set.c
@@ -173,7 +173,7 @@ class CommandBSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "SET", BOT_SET_SYNTAX);
}
diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c
index 25a5c2ada..605bc3c37 100644
--- a/src/core/bs_unassign.c
+++ b/src/core/bs_unassign.c
@@ -50,7 +50,7 @@ class CommandBSUnassign : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_BotServ, u, "UNASSIGN", BOT_UNASSIGN_SYNTAX);
}
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index b8792bfca..62ac477a2 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -153,7 +153,7 @@ class CommandCSAccess : public Command
* If DEL, we require a nick and no level.
* Else (ADD), we require a level (which implies a nick). */
if (is_list || cmd == "CLEAR" ? 0 : (cmd == "DEL" ? (!nick || s) : !s))
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, cmd);
/* We still allow LIST in xOP mode, but not others */
else if ((ci->HasFlag(CI_XOP)) && !is_list)
{
@@ -404,7 +404,7 @@ class CommandCSAccess : public Command
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -415,7 +415,7 @@ class CommandCSAccess : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "ACCESS", CHAN_ACCESS_SYNTAX);
}
@@ -445,7 +445,7 @@ class CommandCSLevels : public Command
* one; else, we want none.
*/
if (cmd == "SET" ? !s : (cmd.substr(0, 3) == "DIS" ? (!what || s) : !!what))
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, cmd);
else if (ci->HasFlag(CI_XOP))
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
else if (!IsFounder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
@@ -454,7 +454,7 @@ class CommandCSLevels : public Command
level = strtol(s, &error, 10);
if (*error != '\0') {
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "SET");
return MOD_CONT;
}
@@ -535,7 +535,7 @@ class CommandCSLevels : public Command
s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name);
notice_lang(s_ChanServ, u, CHAN_LEVELS_RESET, chan);
} else {
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
}
return MOD_CONT;
}
@@ -546,7 +546,7 @@ class CommandCSLevels : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "LEVELS", CHAN_LEVELS_SYNTAX);
}
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index c0f3fc12c..8d2faffa5 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -534,7 +534,7 @@ class CommandCSAKick : public Command
ChannelInfo *ci = cs_findchan(chan.c_str());
if (mask.empty() && (cmd == "ADD" || cmd == "STICK" || cmd == "UNSTICK" || cmd == "DEL"))
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, cmd);
else if (!check_access(u, ci, CA_AKICK) && !u->nc->HasPriv("chanserv/access/modify"))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else if (cmd != "LIST" && cmd != "VIEW" && cmd != "ENFORCE" && readonly)
@@ -556,7 +556,7 @@ class CommandCSAKick : public Command
else if (cmd == "CLEAR")
this->DoClear(u, ci, params);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -567,7 +567,7 @@ class CommandCSAKick : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "AKICK", CHAN_AKICK_SYNTAX);
}
diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c
index dcb051eb2..560563ce8 100644
--- a/src/core/cs_ban.c
+++ b/src/core/cs_ban.c
@@ -104,7 +104,7 @@ class CommandCSBan : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "BAN", CHAN_BAN_SYNTAX);
}
@@ -151,7 +151,7 @@ class CommandCSUnban : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "UNBAN", CHAN_UNBAN_SYNTAX);
}
diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c
index a4f6cd224..e59e4ab4e 100644
--- a/src/core/cs_clear.c
+++ b/src/core/cs_clear.c
@@ -275,7 +275,7 @@ class CommandCSClear : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX);
}
diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c
index 5d4c43bfb..8363b9400 100644
--- a/src/core/cs_drop.c
+++ b/src/core/cs_drop.c
@@ -102,7 +102,7 @@ class CommandCSDrop : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DROP", CHAN_DROP_SYNTAX);
}
diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c
index c4c916c1b..5ca5b395c 100644
--- a/src/core/cs_forbid.c
+++ b/src/core/cs_forbid.c
@@ -112,7 +112,7 @@ class CommandCSForbid : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX);
}
diff --git a/src/core/cs_getkey.c b/src/core/cs_getkey.c
index 447b866b7..387769aee 100644
--- a/src/core/cs_getkey.c
+++ b/src/core/cs_getkey.c
@@ -52,7 +52,7 @@ class CommandCSGetKey : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "GETKEY", CHAN_GETKEY_SYNTAX);
}
diff --git a/src/core/cs_help.c b/src/core/cs_help.c
index 267483f8d..e610e0634 100644
--- a/src/core/cs_help.c
+++ b/src/core/cs_help.c
@@ -52,7 +52,7 @@ class CommandCSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
notice_help(s_ChanServ, u, CHAN_HELP);
FOREACH_MOD(I_OnChanServHelp, OnChanServHelp(u));
diff --git a/src/core/cs_info.c b/src/core/cs_info.c
index 6d89ada02..a52e411f2 100644
--- a/src/core/cs_info.c
+++ b/src/core/cs_info.c
@@ -158,7 +158,7 @@ class CommandCSInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "INFO", CHAN_INFO_SYNTAX);
}
diff --git a/src/core/cs_invite.c b/src/core/cs_invite.c
index c51d85300..d73d7693f 100644
--- a/src/core/cs_invite.c
+++ b/src/core/cs_invite.c
@@ -70,7 +70,7 @@ class CommandCSInvite : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "INVITE", CHAN_INVITE_SYNTAX);
}
diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c
index 6bea58a9f..7d2a9f880 100644
--- a/src/core/cs_kick.c
+++ b/src/core/cs_kick.c
@@ -87,7 +87,7 @@ class CommandCSKick : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "KICK", CHAN_KICK_SYNTAX);
}
diff --git a/src/core/cs_list.c b/src/core/cs_list.c
index af5636e4e..3e05c9ad8 100644
--- a/src/core/cs_list.c
+++ b/src/core/cs_list.c
@@ -177,7 +177,7 @@ public:
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "LIST", CHAN_LIST_SYNTAX);
}
diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c
index 981591e77..998b5fdd9 100644
--- a/src/core/cs_modes.c
+++ b/src/core/cs_modes.c
@@ -95,7 +95,7 @@ class CommandCSOp : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "OP", CHAN_OP_SYNTAX);
}
@@ -122,7 +122,7 @@ class CommandCSDeOp : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DEOP", CHAN_DEOP_SYNTAX);
}
@@ -149,7 +149,7 @@ class CommandCSVoice : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "VOICE", CHAN_VOICE_SYNTAX);
}
@@ -176,7 +176,7 @@ class CommandCSDeVoice : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DEVOICE", CHAN_DEVOICE_SYNTAX);
}
@@ -208,7 +208,7 @@ class CommandCSHalfOp : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "HALFOP", CHAN_HALFOP_SYNTAX);
}
@@ -241,7 +241,7 @@ class CommandCSDeHalfOp : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DEHALFOP", CHAN_DEHALFOP_SYNTAX);
}
@@ -273,7 +273,7 @@ class CommandCSProtect : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "PROTECT", CHAN_PROTECT_SYNTAX);
}
@@ -304,7 +304,7 @@ class CommandCSDeProtect : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DEPROTECT", CHAN_DEPROTECT_SYNTAX);
}
@@ -335,7 +335,7 @@ class CommandCSOwner : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "OWNER", CHAN_OWNER_SYNTAX);
}
@@ -366,7 +366,7 @@ class CommandCSDeOwner : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "DEOWNER", CHAN_DEOWNER_SYNTAX);
}
diff --git a/src/core/cs_register.c b/src/core/cs_register.c
index dbe421110..6c274ae04 100644
--- a/src/core/cs_register.c
+++ b/src/core/cs_register.c
@@ -107,7 +107,7 @@ class CommandCSRegister : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "REGISTER", CHAN_REGISTER_SYNTAX);
}
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 536f04bc6..270eda891 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -308,7 +308,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_KEEPTOPIC_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET KEEPTOPIC", CHAN_SET_KEEPTOPIC_SYNTAX);
+ this->OnSyntaxError(u, "KEEPTOPIC");
return MOD_CONT;
}
@@ -326,7 +326,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_TOPICLOCK_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET TOPICLOCK", CHAN_SET_TOPICLOCK_SYNTAX);
+ this->OnSyntaxError(u, "TOPICLOCK");
return MOD_CONT;
}
@@ -344,7 +344,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_PRIVATE_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET PRIVATE", CHAN_SET_PRIVATE_SYNTAX);
+ this->OnSyntaxError(u, "PRIVATE");
return MOD_CONT;
}
@@ -362,7 +362,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_SECUREOPS_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET SECUREOPS", CHAN_SET_SECUREOPS_SYNTAX);
+ this->OnSyntaxError(u, "SECUREOPS");
return MOD_CONT;
}
@@ -380,7 +380,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_SECUREFOUNDER_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET SECUREFOUNDER", CHAN_SET_SECUREFOUNDER_SYNTAX);
+ this->OnSyntaxError(u, "SECUREFOUNDER");
return MOD_CONT;
}
@@ -402,7 +402,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_RESTRICTED_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET RESTRICTED", CHAN_SET_RESTRICTED_SYNTAX);
+ this->OnSyntaxError(u, "RESTRICTED");
return MOD_CONT;
}
@@ -420,7 +420,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_SECURE_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET SECURE", CHAN_SET_SECURE_SYNTAX);
+ this->OnSyntaxError(u, "SECURE");
return MOD_CONT;
}
@@ -446,7 +446,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_SIGNKICK_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET SIGNKICK", CHAN_SET_SIGNKICK_SYNTAX);
+ this->OnSyntaxError(u, "SIGNKICK");
return MOD_CONT;
}
@@ -464,7 +464,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_OPNOTICE_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET OPNOTICE", CHAN_SET_OPNOTICE_SYNTAX);
+ this->OnSyntaxError(u, "OPNOTICE");
return MOD_CONT;
}
@@ -525,7 +525,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_XOP_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET XOP", CHAN_SET_XOP_SYNTAX);
+ this->OnSyntaxError(u, "XOP");
return MOD_CONT;
}
@@ -545,7 +545,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_PEACE_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET PEACE", CHAN_SET_PEACE_SYNTAX);
+ this->OnSyntaxError(u, "PEACE");
return MOD_CONT;
}
@@ -621,7 +621,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_PERSIST_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET PERSIST", CHAN_SET_PERSIST_SYNTAX);
+ this->OnSyntaxError(u, "PERSIST");
return MOD_CONT;
}
@@ -644,7 +644,7 @@ class CommandCSSet : public Command
notice_lang(s_ChanServ, u, CHAN_SET_NOEXPIRE_OFF, ci->name);
}
else
- syntax_error(s_ChanServ, u, "SET NOEXPIRE", CHAN_SET_NOEXPIRE_SYNTAX);
+ this->OnSyntaxError(u, "NOEXPIRE");
return MOD_CONT;
}
@@ -658,7 +658,7 @@ class CommandCSSet : public Command
{
const char *chan = params[0].c_str();
ci::string cmd = params[1];
- const char *param = params.size() > 2 ? params[2].c_str() : NULL;
+ ci::string param = params.size() > 2 ? params[2] : "";
ChannelInfo *ci = cs_findchan(chan);
bool is_servadmin = u->nc->HasPriv("chanserv/set");
@@ -667,8 +667,8 @@ class CommandCSSet : public Command
return MOD_CONT;
}
- if (!param && cmd != "SUCCESSOR" && cmd != "URL" && cmd != "EMAIL" && cmd != "ENTRYMSG" && cmd != "MLOCK")
- syntax_error(s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
+ if (param.empty() && cmd != "SUCCESSOR" && cmd != "URL" && cmd != "EMAIL" && cmd != "ENTRYMSG" && cmd != "MLOCK")
+ this->OnSyntaxError(u, cmd);
else if (!is_servadmin && !check_access(u, ci, CA_SET))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else if (cmd == "FOUNDER")
@@ -696,9 +696,9 @@ class CommandCSSet : public Command
else if (cmd == "TOPIC")
notice_lang(s_ChanServ, u, OBSOLETE_COMMAND, "TOPIC");
else if (cmd == "BANTYPE")
- DoSetBanType(u, ci, param);
+ DoSetBanType(u, ci, param.c_str());
else if (cmd == "MLOCK")
- DoSetMLock(u, ci, param);
+ DoSetMLock(u, ci, param.c_str());
else if (cmd == "KEEPTOPIC")
DoSetKeepTopic(u, ci, param);
else if (cmd == "TOPICLOCK")
@@ -800,9 +800,45 @@ class CommandCSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
- syntax_error(s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
+ int reply = CHAN_SET_SYNTAX;
+ ci::string command = "SET";
+
+ if (!subcommand.empty())
+ {
+ if (subcommand == "KEEPTOPIC")
+ reply = CHAN_SET_KEEPTOPIC_SYNTAX;
+ else if (subcommand == "TOPICLOCK")
+ reply = CHAN_SET_TOPICLOCK_SYNTAX;
+ else if (subcommand == "PRIVATE")
+ reply = CHAN_SET_PRIVATE_SYNTAX;
+ else if (subcommand == "SECUREOPS")
+ reply = CHAN_SET_SECUREOPS_SYNTAX;
+ else if (subcommand == "SECUREFOUNDER")
+ reply = CHAN_SET_SECUREFOUNDER_SYNTAX;
+ else if (subcommand == "RESTRICTED")
+ reply = CHAN_SET_RESTRICTED_SYNTAX;
+ else if (subcommand == "SECURE")
+ reply = CHAN_SET_SECURE_SYNTAX;
+ else if (subcommand == "SIGNKICK")
+ reply = CHAN_SET_SIGNKICK_SYNTAX;
+ else if (subcommand == "OPNOTICE")
+ reply = CHAN_SET_OPNOTICE_SYNTAX;
+ else if (subcommand == "XOP")
+ reply = CHAN_SET_XOP_SYNTAX;
+ else if (subcommand == "PEACE")
+ reply = CHAN_SET_PEACE_SYNTAX;
+ else if (subcommand == "PERSIST")
+ reply = CHAN_SET_PERSIST_SYNTAX;
+ else if (subcommand == "NOEXPIRE")
+ reply = CHAN_SET_NOEXPIRE_SYNTAX;
+
+ if (reply != CHAN_SET_SYNTAX)
+ command += " " + subcommand;
+ }
+
+ syntax_error(s_ChanServ, u, command.c_str(), reply);
}
};
diff --git a/src/core/cs_status.c b/src/core/cs_status.c
index cada09062..71c998dc1 100644
--- a/src/core/cs_status.c
+++ b/src/core/cs_status.c
@@ -52,7 +52,7 @@ class CommandCSStatus : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "STATUS", CHAN_STATUS_SYNTAX);
}
diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c
index 7d29509b3..af8edfe35 100644
--- a/src/core/cs_suspend.c
+++ b/src/core/cs_suspend.c
@@ -33,7 +33,7 @@ class CommandCSSuspend : public Command
/* Assumes that permission checking has already been done. */
if (ForceForbidReason && !reason)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -102,7 +102,7 @@ class CommandCSSuspend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "SUSPEND", ForceForbidReason ? CHAN_SUSPEND_SYNTAX_REASON : CHAN_SUSPEND_SYNTAX);
}
@@ -172,7 +172,7 @@ class CommandCSUnSuspend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "UNSUSPEND", CHAN_UNSUSPEND_SYNTAX);
}
diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c
index ab7b5e7c4..9d461b69a 100644
--- a/src/core/cs_topic.c
+++ b/src/core/cs_topic.c
@@ -74,7 +74,7 @@ class CommandCSTopic : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "TOPIC", CHAN_TOPIC_SYNTAX);
}
diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c
index 8dfbf8a85..81dd80224 100644
--- a/src/core/cs_xop.c
+++ b/src/core/cs_xop.c
@@ -126,7 +126,7 @@ class XOPBase : public Command
if (!nick)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -214,7 +214,7 @@ class XOPBase : public Command
if (!nick)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -391,7 +391,7 @@ class XOPBase : public Command
else if (cmd == "CLEAR")
return this->DoClear(u, params, ci, level, messages);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
public:
@@ -407,7 +407,7 @@ class XOPBase : public Command
virtual bool OnHelp(User *u, const ci::string &subcommand) = 0;
- virtual void OnSyntaxError(User *u) = 0;
+ virtual void OnSyntaxError(User *u, const ci::string &subcommand) = 0;
};
class CommandCSQOP : public XOPBase
@@ -428,7 +428,7 @@ class CommandCSQOP : public XOPBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "QOP", CHAN_QOP_SYNTAX);
}
@@ -452,7 +452,7 @@ class CommandCSAOP : public XOPBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "AOP", CHAN_AOP_SYNTAX);
}
@@ -476,7 +476,7 @@ class CommandCSHOP : public XOPBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "HOP", CHAN_HOP_SYNTAX);
}
@@ -500,7 +500,7 @@ class CommandCSSOP : public XOPBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "SOP", CHAN_SOP_SYNTAX);
}
@@ -524,7 +524,7 @@ class CommandCSVOP : public XOPBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_ChanServ, u, "VOP", CHAN_VOP_SYNTAX);
}
diff --git a/src/core/hs_del.c b/src/core/hs_del.c
index 080aff1c2..48187cbb9 100644
--- a/src/core/hs_del.c
+++ b/src/core/hs_del.c
@@ -48,7 +48,7 @@ class CommandHSDel : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_HostServ, u, "DEL", HOST_DEL_SYNTAX);
}
diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c
index 82eef36a9..e1cc2cb94 100644
--- a/src/core/hs_delall.c
+++ b/src/core/hs_delall.c
@@ -55,7 +55,7 @@ class CommandHSDelAll : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_HostServ, u, "DELALL", HOST_DELALL_SYNTAX);
}
diff --git a/src/core/hs_help.c b/src/core/hs_help.c
index da0e6d4ee..24d3946c8 100644
--- a/src/core/hs_help.c
+++ b/src/core/hs_help.c
@@ -29,7 +29,7 @@ class CommandHSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
notice_help(s_HostServ, u, HOST_HELP, s_HostServ);
FOREACH_MOD(I_OnHostServHelp, OnHostServHelp(u));
diff --git a/src/core/hs_set.c b/src/core/hs_set.c
index 5db2c4f25..c9b1857f5 100644
--- a/src/core/hs_set.c
+++ b/src/core/hs_set.c
@@ -145,7 +145,7 @@ class CommandHSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_HostServ, u, "SET", HOST_SET_SYNTAX);
}
diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c
index 344ed1e51..e0eed6406 100644
--- a/src/core/hs_setall.c
+++ b/src/core/hs_setall.c
@@ -146,7 +146,7 @@ class CommandHSSetAll : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_HostServ, u, "SETALL", HOST_SETALL_SYNTAX);
}
diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c
index 9a43a7e3a..2277a7e8e 100644
--- a/src/core/ms_cancel.c
+++ b/src/core/ms_cancel.c
@@ -65,7 +65,7 @@ class CommandMSCancel : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "CANCEL", MEMO_CANCEL_SYNTAX);
}
diff --git a/src/core/ms_check.c b/src/core/ms_check.c
index b415f3472..f297b3cbf 100644
--- a/src/core/ms_check.c
+++ b/src/core/ms_check.c
@@ -82,7 +82,7 @@ class CommandMSCheck : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "CHECK", MEMO_CHECK_SYNTAX);
}
diff --git a/src/core/ms_del.c b/src/core/ms_del.c
index e45ad08a5..405db50cf 100644
--- a/src/core/ms_del.c
+++ b/src/core/ms_del.c
@@ -60,7 +60,7 @@ class CommandMSDel : public Command
mi = &u->nc->memos;
}
if (numstr.empty() || (!isdigit(numstr[0]) && numstr != "ALL" && numstr != "LAST"))
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, numstr);
else if (mi->memos.empty())
{
if (!chan.empty())
@@ -138,7 +138,7 @@ class CommandMSDel : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "DEL", MEMO_DEL_SYNTAX);
}
diff --git a/src/core/ms_help.c b/src/core/ms_help.c
index f54ac9e6d..d19daa3b0 100644
--- a/src/core/ms_help.c
+++ b/src/core/ms_help.c
@@ -29,7 +29,7 @@ class CommandMSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
notice_help(s_MemoServ, u, MEMO_HELP_HEADER);
FOREACH_MOD(I_OnMemoServHelp, OnMemoServHelp(u));
diff --git a/src/core/ms_list.c b/src/core/ms_list.c
index f7dd10d82..51b8182f3 100644
--- a/src/core/ms_list.c
+++ b/src/core/ms_list.c
@@ -54,7 +54,7 @@ class CommandMSList : public Command
mi = &u->nc->memos;
}
if (!param.empty() && !isdigit(param[0]) && param != "NEW")
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, param);
else if (!mi->memos.size())
{
if (!chan.empty())
@@ -102,7 +102,7 @@ class CommandMSList : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "LIST", MEMO_LIST_SYNTAX);
}
diff --git a/src/core/ms_read.c b/src/core/ms_read.c
index 7573ddbb7..7329c0fde 100644
--- a/src/core/ms_read.c
+++ b/src/core/ms_read.c
@@ -56,7 +56,7 @@ class CommandMSRead : public Command
}
num = !numstr.empty() ? atoi(numstr.c_str()) : -1;
if (numstr.empty() || (numstr != "LAST" && numstr != "NEW" && num <= 0))
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, numstr);
else if (mi->memos.empty())
{
if (!chan.empty())
@@ -111,7 +111,7 @@ class CommandMSRead : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "READ", MEMO_READ_SYNTAX);
}
diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c
index 9aafbbf1d..eeb39de6a 100644
--- a/src/core/ms_rsend.c
+++ b/src/core/ms_rsend.c
@@ -72,7 +72,7 @@ class CommandMSRSend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "RSEND", MEMO_RSEND_SYNTAX);
}
diff --git a/src/core/ms_send.c b/src/core/ms_send.c
index 992b3ed36..7db68a03f 100644
--- a/src/core/ms_send.c
+++ b/src/core/ms_send.c
@@ -37,7 +37,7 @@ class CommandMSSend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "SEND", MEMO_SEND_SYNTAX);
}
diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c
index 7bed4ebac..180bbf869 100644
--- a/src/core/ms_sendall.c
+++ b/src/core/ms_sendall.c
@@ -53,7 +53,7 @@ class CommandMSSendAll : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "SENDALL", MEMO_SEND_SYNTAX);
}
diff --git a/src/core/ms_set.c b/src/core/ms_set.c
index 334990660..b8d08d6dd 100644
--- a/src/core/ms_set.c
+++ b/src/core/ms_set.c
@@ -248,7 +248,7 @@ class CommandMSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "SET", MEMO_SET_SYNTAX);
}
diff --git a/src/core/ms_staff.c b/src/core/ms_staff.c
index 76114ada5..ab08cb3ca 100644
--- a/src/core/ms_staff.c
+++ b/src/core/ms_staff.c
@@ -51,7 +51,7 @@ class CommandMSStaff : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_MemoServ, u, "STAFF", MEMO_STAFF_SYNTAX);
}
diff --git a/src/core/ns_access.c b/src/core/ns_access.c
index 43edd846f..e6a0b12b3 100644
--- a/src/core/ns_access.c
+++ b/src/core/ns_access.c
@@ -59,7 +59,7 @@ class CommandNSAccess : public Command
{
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -85,7 +85,7 @@ class CommandNSAccess : public Command
{
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -155,7 +155,7 @@ class CommandNSAccess : public Command
else if (cmd == "LIST")
return this->DoList(u, u->nc, mask);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -165,7 +165,7 @@ class CommandNSAccess : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "ACCESS", NICK_ACCESS_SYNTAX);
}
diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c
index 4fe0412d9..c76f2a67c 100644
--- a/src/core/ns_forbid.c
+++ b/src/core/ns_forbid.c
@@ -30,7 +30,7 @@ class CommandNSForbid : public Command
/* Assumes that permission checking has already been done. */
if (ForceForbidReason && !reason) {
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -92,7 +92,7 @@ class CommandNSForbid : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "FORBID", ForceForbidReason ? NICK_FORBID_SYNTAX_REASON : NICK_FORBID_SYNTAX);
}
diff --git a/src/core/ns_getemail.c b/src/core/ns_getemail.c
index 636b703be..91fb28331 100644
--- a/src/core/ns_getemail.c
+++ b/src/core/ns_getemail.c
@@ -62,7 +62,7 @@ class CommandNSGetEMail : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "GETMAIL", NICK_GETEMAIL_SYNTAX);
}
diff --git a/src/core/ns_getpass.c b/src/core/ns_getpass.c
index aa524eacd..9dcf0d3d5 100644
--- a/src/core/ns_getpass.c
+++ b/src/core/ns_getpass.c
@@ -66,7 +66,7 @@ class CommandNSGetPass : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "GETPASS", NICK_GETPASS_SYNTAX);
}
diff --git a/src/core/ns_ghost.c b/src/core/ns_ghost.c
index a7823f063..3e867511f 100644
--- a/src/core/ns_ghost.c
+++ b/src/core/ns_ghost.c
@@ -80,7 +80,7 @@ class CommandNSGhost : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "GHOST", NICK_GHOST_SYNTAX);
}
diff --git a/src/core/ns_group.c b/src/core/ns_group.c
index f079e2a99..3961f1dd1 100644
--- a/src/core/ns_group.c
+++ b/src/core/ns_group.c
@@ -143,7 +143,7 @@ class CommandNSGroup : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "GROUP", NICK_GROUP_SYNTAX);
}
diff --git a/src/core/ns_help.c b/src/core/ns_help.c
index 29c71a5c5..6a4f630b0 100644
--- a/src/core/ns_help.c
+++ b/src/core/ns_help.c
@@ -40,7 +40,7 @@ class CommandNSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
notice_help(s_NickServ, u, NICK_HELP);
FOREACH_MOD(I_OnNickServHelp, OnNickServHelp(u));
diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c
index 3204537a0..6f18a39c9 100644
--- a/src/core/ns_identify.c
+++ b/src/core/ns_identify.c
@@ -106,7 +106,7 @@ class CommandNSIdentify : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "IDENTIFY", NICK_IDENTIFY_SYNTAX);
}
diff --git a/src/core/ns_info.c b/src/core/ns_info.c
index c0066a67a..104cad7b6 100644
--- a/src/core/ns_info.c
+++ b/src/core/ns_info.c
@@ -201,7 +201,7 @@ class CommandNSInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "INFO", NICK_INFO_SYNTAX);
}
diff --git a/src/core/ns_list.c b/src/core/ns_list.c
index b411355a9..a394c0b1e 100644
--- a/src/core/ns_list.c
+++ b/src/core/ns_list.c
@@ -203,7 +203,7 @@ class CommandNSList : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
if (u->nc->IsServicesOper())
syntax_error(s_NickServ, u, "LIST", NICK_LIST_SERVADMIN_SYNTAX);
diff --git a/src/core/ns_logout.c b/src/core/ns_logout.c
index 5074ddf95..90bf4d7de 100644
--- a/src/core/ns_logout.c
+++ b/src/core/ns_logout.c
@@ -33,7 +33,7 @@ class CommandNSLogout : public Command
NickAlias *na;
if (!u->nc->IsServicesOper() && nick)
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
else if (!(u2 = (nick ? finduser(nick) : u)))
notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
else if (nick && u2->nc && !u2->nc->IsServicesOper())
@@ -84,7 +84,7 @@ class CommandNSLogout : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "LOGOUT", NICK_LOGOUT_SYNTAX);
}
diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c
index 0b406c120..7819752e0 100644
--- a/src/core/ns_recover.c
+++ b/src/core/ns_recover.c
@@ -99,7 +99,7 @@ class CommandNSRecover : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "RECOVER", NICK_RECOVER_SYNTAX);
}
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 27cb51786..669f7b573 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -240,7 +240,7 @@ class CommandNSRegister : public CommandNSConfirm
}
if (NSForceEmail && !email)
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
else if (time(NULL) < u->lastnickreg + NSRegDelay)
notice_lang(s_NickServ, u, NICK_REG_PLEASE_WAIT, (u->lastnickreg + NSRegDelay) - time(NULL));
else if ((na = findnick(u->nick)))
@@ -304,7 +304,7 @@ class CommandNSRegister : public CommandNSConfirm
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
if (NSForceEmail)
syntax_error(s_NickServ, u, "REGISTER", NICK_REGISTER_SYNTAX_EMAIL);
diff --git a/src/core/ns_release.c b/src/core/ns_release.c
index a789a9e0a..a5fc3447a 100644
--- a/src/core/ns_release.c
+++ b/src/core/ns_release.c
@@ -81,7 +81,7 @@ class CommandNSRelease : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "RELEASE", NICK_RELEASE_SYNTAX);
}
diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c
index 2545a4060..dac66acee 100644
--- a/src/core/ns_saset.c
+++ b/src/core/ns_saset.c
@@ -26,7 +26,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DISPLAY");
return MOD_CONT;
}
@@ -58,7 +58,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "PASSWORD");
return MOD_CONT;
}
@@ -213,7 +213,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "KILL");
return MOD_CONT;
}
@@ -261,7 +261,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "SECURE");
return MOD_CONT;
}
@@ -286,7 +286,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "PRIVATE");
return MOD_CONT;
}
@@ -311,7 +311,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "MSG");
return MOD_CONT;
}
@@ -342,7 +342,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "HIDE");
return MOD_CONT;
}
@@ -428,7 +428,7 @@ private:
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "AUTOOP");
return MOD_CONT;
}
@@ -454,7 +454,7 @@ private:
if (!param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "LANGUAGE");
return MOD_CONT;
}
@@ -574,7 +574,7 @@ public:
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "SASET", NICK_SASET_SYNTAX);
}
diff --git a/src/core/ns_sendpass.c b/src/core/ns_sendpass.c
index f5fcb1790..7ccd3b081 100644
--- a/src/core/ns_sendpass.c
+++ b/src/core/ns_sendpass.c
@@ -77,7 +77,7 @@ class CommandNSSendPass : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "SENDPASS", NICK_SENDPASS_SYNTAX);
}
diff --git a/src/core/ns_set.c b/src/core/ns_set.c
index b2f21e3e6..9b1c14b94 100644
--- a/src/core/ns_set.c
+++ b/src/core/ns_set.c
@@ -24,7 +24,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DISPLAY");
return MOD_CONT;
}
@@ -59,7 +59,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "PASSWORD");
return MOD_CONT;
}
@@ -102,7 +102,7 @@ class CommandNSSet : public Command
if (!param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "LANGUAGE");
return MOD_CONT;
}
@@ -231,7 +231,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "KILL");
return MOD_CONT;
}
@@ -279,7 +279,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "SECURE");
return MOD_CONT;
}
@@ -304,7 +304,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "PRIVATE");
return MOD_CONT;
}
@@ -329,7 +329,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "MSG");
return MOD_CONT;
}
@@ -360,7 +360,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "HIDE");
return MOD_CONT;
}
@@ -421,7 +421,7 @@ class CommandNSSet : public Command
if (param.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "AUTOOP");
return MOD_CONT;
}
@@ -531,7 +531,7 @@ class CommandNSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "SET", NICK_SET_SYNTAX);
}
diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c
index 2d32d337d..595299c7a 100644
--- a/src/core/ns_suspend.c
+++ b/src/core/ns_suspend.c
@@ -100,7 +100,7 @@ class CommandNSSuspend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "SUSPEND", NICK_SUSPEND_SYNTAX);
}
@@ -168,7 +168,7 @@ class CommandNSUnSuspend : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_NickServ, u, "UNSUSPEND", NICK_UNSUSPEND_SYNTAX);
}
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index 9bdc97789..3101f8300 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -58,7 +58,7 @@ class CommandOSAKill : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : "");
@@ -136,7 +136,7 @@ class CommandOSAKill : public Command
notice_lang(s_OperServ, u, READ_ONLY_MODE);
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -150,7 +150,7 @@ class CommandOSAKill : public Command
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -305,7 +305,7 @@ class CommandOSAKill : public Command
else if (cmd == "CLEAR")
return this->DoClear(u);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -315,7 +315,7 @@ class CommandOSAKill : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "AKILL", OPER_AKILL_SYNTAX);
}
diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c
index 0d96690b2..2937e0136 100644
--- a/src/core/os_chankill.c
+++ b/src/core/os_chankill.c
@@ -55,7 +55,7 @@ class CommandOSChanKill : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s", params[last_param].c_str(), (params.size() > last_param + 1 ? params[last_param + 1].c_str() : ""));
@@ -94,7 +94,7 @@ class CommandOSChanKill : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "CHANKILL", OPER_CHANKILL_SYNTAX);
}
diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c
index 8150ae010..fb614138b 100644
--- a/src/core/os_clearmodes.c
+++ b/src/core/os_clearmodes.c
@@ -49,7 +49,7 @@ class CommandOSClearModes : public Command
if (s == "ALL")
all = 1;
else {
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
}
@@ -171,7 +171,7 @@ class CommandOSClearModes : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "CLEARMODES", OPER_CLEARMODES_SYNTAX);
}
diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c
index 81d25624f..d8119e7c0 100644
--- a/src/core/os_defcon.c
+++ b/src/core/os_defcon.c
@@ -77,7 +77,7 @@ class CommandOSDEFCON : public Command
newLevel = atoi(lvl);
if (newLevel < 1 || newLevel > 5)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
DefConLevel = newLevel;
@@ -122,7 +122,7 @@ class CommandOSDEFCON : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "DEFCON", OPER_DEFCON_SYNTAX);
}
diff --git a/src/core/os_global.c b/src/core/os_global.c
index bb44ed911..9182e6acd 100644
--- a/src/core/os_global.c
+++ b/src/core/os_global.c
@@ -38,7 +38,7 @@ class CommandOSGlobal : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "GLOBAL", OPER_GLOBAL_SYNTAX);
}
diff --git a/src/core/os_help.c b/src/core/os_help.c
index bbff487f7..698bdd209 100644
--- a/src/core/os_help.c
+++ b/src/core/os_help.c
@@ -28,7 +28,7 @@ class CommandOSHelp : public Command
return MOD_CONT;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
notice_help(s_OperServ, u, OPER_HELP);
FOREACH_MOD(I_OnOperServHelp, OnOperServHelp(u));
diff --git a/src/core/os_ignore.c b/src/core/os_ignore.c
index f841fa0a8..0bb41a79e 100644
--- a/src/core/os_ignore.c
+++ b/src/core/os_ignore.c
@@ -26,7 +26,7 @@ class CommandOSIgnore : public Command
if (!time || !nick)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
else
@@ -74,7 +74,7 @@ class CommandOSIgnore : public Command
{
const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
if (!nick)
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
else
{
if (delete_ignore(nick))
@@ -113,7 +113,7 @@ class CommandOSIgnore : public Command
else if (cmd == "CLEAR")
return this->DoClear(u);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -124,7 +124,7 @@ class CommandOSIgnore : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "IGNORE", OPER_IGNORE_SYNTAX);
}
diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c
index 1027d31ca..4d6706848 100644
--- a/src/core/os_jupe.c
+++ b/src/core/os_jupe.c
@@ -52,7 +52,7 @@ class CommandOSJupe : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "JUPE", OPER_JUPE_SYNTAX);
}
diff --git a/src/core/os_kick.c b/src/core/os_kick.c
index 19b95524c..63e57c276 100644
--- a/src/core/os_kick.c
+++ b/src/core/os_kick.c
@@ -57,7 +57,7 @@ class CommandOSKick : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "KICK", OPER_KICK_SYNTAX);
}
diff --git a/src/core/os_mode.c b/src/core/os_mode.c
index 616db1690..cf273f616 100644
--- a/src/core/os_mode.c
+++ b/src/core/os_mode.c
@@ -53,7 +53,7 @@ class CommandOSMode : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "MODE", OPER_MODE_SYNTAX);
}
diff --git a/src/core/os_modinfo.c b/src/core/os_modinfo.c
index 594355b3b..1a358fd93 100644
--- a/src/core/os_modinfo.c
+++ b/src/core/os_modinfo.c
@@ -59,7 +59,7 @@ class CommandOSModInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "MODINFO", OPER_MODULE_INFO_SYNTAX);
}
diff --git a/src/core/os_modload.c b/src/core/os_modload.c
index 0e3b5d3fb..e92d21a10 100644
--- a/src/core/os_modload.c
+++ b/src/core/os_modload.c
@@ -48,7 +48,7 @@ class CommandOSModLoad : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "MODLOAD", OPER_MODULE_LOAD_SYNTAX);
}
diff --git a/src/core/os_modunload.c b/src/core/os_modunload.c
index 36a0c48b3..f694277dd 100644
--- a/src/core/os_modunload.c
+++ b/src/core/os_modunload.c
@@ -50,7 +50,7 @@ class CommandOSModUnLoad : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "MODUNLOAD", OPER_MODULE_UNLOAD_SYNTAX);
}
diff --git a/src/core/os_news.c b/src/core/os_news.c
index dc6bfaa3c..a0f7da1ea 100644
--- a/src/core/os_news.c
+++ b/src/core/os_news.c
@@ -305,7 +305,7 @@ class NewsBase : public Command
int n;
if (!text)
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
else
{
if (readonly)
@@ -329,7 +329,7 @@ class NewsBase : public Command
unsigned num;
if (!text)
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
else
{
if (readonly)
@@ -384,7 +384,7 @@ class NewsBase : public Command
else if (cmd == "DEL")
return this->DoDel(u, params, type, msgs);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -401,7 +401,7 @@ class NewsBase : public Command
virtual bool OnHelp(User *u, const ci::string &subcommand) = 0;
- virtual void OnSyntaxError(User *u) = 0;
+ virtual void OnSyntaxError(User *u, const ci::string &subcommand) = 0;
};
class CommandOSLogonNews : public NewsBase
@@ -422,7 +422,7 @@ class CommandOSLogonNews : public NewsBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "LOGONNEWS", NEWS_LOGON_SYNTAX);
}
@@ -446,7 +446,7 @@ class CommandOSOperNews : public NewsBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "OPERNEWS", NEWS_OPER_SYNTAX);
}
@@ -470,7 +470,7 @@ class CommandOSRandomNews : public NewsBase
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "RANDOMNEWS", NEWS_RANDOM_SYNTAX);
}
diff --git a/src/core/os_noop.c b/src/core/os_noop.c
index 13fa7767c..9d17547f1 100644
--- a/src/core/os_noop.c
+++ b/src/core/os_noop.c
@@ -55,7 +55,7 @@ class CommandOSNOOP : public Command
notice_lang(s_OperServ, u, OPER_NOOP_REVOKE, server);
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -65,7 +65,7 @@ class CommandOSNOOP : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "NOOP", OPER_NOOP_SYNTAX);
}
diff --git a/src/core/os_oline.c b/src/core/os_oline.c
index 424ad5867..84eea8ab0 100644
--- a/src/core/os_oline.c
+++ b/src/core/os_oline.c
@@ -46,7 +46,7 @@ class CommandOSOLine : public Command
ircdproto->SendGlobops(s_OperServ, "\2%s\2 used OLINE for %s", u->nick, nick);
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -56,7 +56,7 @@ class CommandOSOLine : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "OLINE", OPER_OLINE_SYNTAX);
}
diff --git a/src/core/os_session.c b/src/core/os_session.c
index c484f35d9..46e6bd351 100644
--- a/src/core/os_session.c
+++ b/src/core/os_session.c
@@ -77,7 +77,7 @@ class CommandOSSession : public Command
else if (cmd == "VIEW")
return this->DoView(u, params);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -87,7 +87,7 @@ class CommandOSSession : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SESSION", OPER_SESSION_LIST_SYNTAX);
}
@@ -208,14 +208,14 @@ class CommandOSException : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 3 && params.size() > 4 ? " " : "", last_param == 3 && params.size() > 4 ? params[4].c_str() : "");
if (!*reason)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -262,7 +262,7 @@ class CommandOSException : public Command
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -323,7 +323,7 @@ class CommandOSException : public Command
if (!n2str)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "MOVE");
return MOD_CONT;
}
@@ -360,7 +360,7 @@ class CommandOSException : public Command
notice_lang(s_OperServ, u, READ_ONLY_MODE);
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "MOVE");
return MOD_CONT;
}
@@ -434,7 +434,7 @@ class CommandOSException : public Command
else if (cmd == "VIEW")
return this->DoView(u, params);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -444,7 +444,7 @@ class CommandOSException : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "EXCEPTION", OPER_EXCEPTION_SYNTAX);
}
diff --git a/src/core/os_set.c b/src/core/os_set.c
index b1e047ac8..6f7f9b03b 100644
--- a/src/core/os_set.c
+++ b/src/core/os_set.c
@@ -42,7 +42,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "IGNORE");
return MOD_CONT;
}
@@ -68,7 +68,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "READONLY");
return MOD_CONT;
}
@@ -99,7 +99,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "LOGCHAN");
return MOD_CONT;
}
@@ -140,7 +140,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "SUPERADMIN");
return MOD_CONT;
}
@@ -177,7 +177,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEBUG");
return MOD_CONT;
}
@@ -211,7 +211,7 @@ class CommandOSSet : public Command
if (setting.empty())
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "NOEXPIRE");
return MOD_CONT;
}
@@ -284,7 +284,7 @@ class CommandOSSet : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SET", OPER_SET_SYNTAX);
}
diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c
index 8feb6682e..18b045706 100644
--- a/src/core/os_sgline.c
+++ b/src/core/os_sgline.c
@@ -59,14 +59,14 @@ class CommandOSSGLine : public Command
if (!param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? params[last_param].c_str() : "");
if (std::string(rest).find(':') == std::string::npos)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -137,7 +137,7 @@ class CommandOSSGLine : public Command
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -151,7 +151,7 @@ class CommandOSSGLine : public Command
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -302,7 +302,7 @@ class CommandOSSGLine : public Command
else if (cmd == "CLEAR")
return this->OnClear(u);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -312,7 +312,7 @@ class CommandOSSGLine : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SGLINE", OPER_SGLINE_SYNTAX);
}
diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c
index 09e6252a4..971cba1b7 100644
--- a/src/core/os_sqline.c
+++ b/src/core/os_sqline.c
@@ -58,7 +58,7 @@ class CommandOSSQLine : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : "");
@@ -123,7 +123,7 @@ class CommandOSSQLine : public Command
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -137,7 +137,7 @@ class CommandOSSQLine : public Command
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -289,7 +289,7 @@ class CommandOSSQLine : public Command
else if (cmd == "CLEAR")
return this->DoClear(u);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -299,7 +299,7 @@ class CommandOSSQLine : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SQLINE", OPER_SQLINE_SYNTAX);
}
diff --git a/src/core/os_svsnick.c b/src/core/os_svsnick.c
index 9ddf700cc..b4ee6090a 100644
--- a/src/core/os_svsnick.c
+++ b/src/core/os_svsnick.c
@@ -75,7 +75,7 @@ class CommandOSSVSNick : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SVSNICK", OPER_SVSNICK_SYNTAX);
}
diff --git a/src/core/os_szline.c b/src/core/os_szline.c
index 5d33db350..fd7f73343 100644
--- a/src/core/os_szline.c
+++ b/src/core/os_szline.c
@@ -58,7 +58,7 @@ class CommandOSSZLine : public Command
if (params.size() <= last_param)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : "");
@@ -123,7 +123,7 @@ class CommandOSSZLine : public Command
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -137,7 +137,7 @@ class CommandOSSZLine : public Command
if (!mask)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "DEL");
return MOD_CONT;
}
@@ -288,7 +288,7 @@ class CommandOSSZLine : public Command
else if (cmd == "CLEAR")
return this->DoClear(u);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -298,7 +298,7 @@ class CommandOSSZLine : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "SZLINE", OPER_SZLINE_SYNTAX);
}
diff --git a/src/core/os_umode.c b/src/core/os_umode.c
index dce06872f..323f4f3c1 100644
--- a/src/core/os_umode.c
+++ b/src/core/os_umode.c
@@ -35,7 +35,7 @@ class CommandOSUMode : public Command
**/
if (modes[0] != '+' && modes[0] != '-')
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
if (!(u2 = finduser(nick)))
@@ -61,7 +61,7 @@ class CommandOSUMode : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
syntax_error(s_OperServ, u, "UMODE", OPER_UMODE_SYNTAX);
}
diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c
index d5b32fe2a..60310b82b 100644
--- a/src/modules/cs_appendtopic.c
+++ b/src/modules/cs_appendtopic.c
@@ -124,7 +124,7 @@ class CommandCSAppendTopic : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_ChanServ, u, LNG_APPENDTOPIC_SYNTAX);
}
diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c
index 47fdedc07..8dc9d0722 100644
--- a/src/modules/cs_enforce.c
+++ b/src/modules/cs_enforce.c
@@ -224,7 +224,7 @@ class CommandCSEnforce : public Command
me->NoticeLang(s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
}
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
}
return MOD_CONT;
@@ -244,7 +244,7 @@ class CommandCSEnforce : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_ChanServ, u, LNG_ENFORCE_SYNTAX);
}
diff --git a/src/modules/cs_tban.c b/src/modules/cs_tban.c
index 9f8f2a2db..1aea779f5 100644
--- a/src/modules/cs_tban.c
+++ b/src/modules/cs_tban.c
@@ -72,14 +72,14 @@ class CommandCSTBan : public Command
bool OnHelp(User *u, const ci::string &subcommand)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
ircdproto->SendMessage(findbot(s_ChanServ), u->nick, " ");
me->NoticeLang(s_ChanServ, u, TBAN_HELP_DETAIL);
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_ChanServ, u, TBAN_SYNTAX);
}
diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c
index 0466f95fe..4601c931b 100644
--- a/src/modules/hs_request.c
+++ b/src/modules/hs_request.c
@@ -193,7 +193,7 @@ class CommandHSRequest : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_HostServ, u, LNG_REQUEST_SYNTAX);
}
@@ -258,7 +258,7 @@ class CommandHSActivate : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_HostServ, u, LNG_ACTIVATE_SYNTAX);
}
@@ -321,7 +321,7 @@ class CommandHSReject : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_HostServ, u, LNG_REJECT_SYNTAX);
}
@@ -370,7 +370,7 @@ class HSListBase : public Command
{
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
// no-op
}
diff --git a/src/modules/os_info.c b/src/modules/os_info.c
index 6298a7744..a56aa724f 100644
--- a/src/modules/os_info.c
+++ b/src/modules/os_info.c
@@ -61,7 +61,7 @@ class CommandNSOInfo : public Command
if (!info)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -119,7 +119,8 @@ class CommandNSOInfo : public Command
else if (cmd == "DEL")
return this->DoDel(u, params);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
+
return MOD_CONT;
}
@@ -129,7 +130,7 @@ class CommandNSOInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_NickServ, u, OINFO_SYNTAX);
}
@@ -147,7 +148,7 @@ class CommandCSOInfo : public Command
if (!info)
{
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "ADD");
return MOD_CONT;
}
@@ -193,7 +194,7 @@ class CommandCSOInfo : public Command
else if (cmd == "DEL")
return this->DoDel(u, params);
else
- this->OnSyntaxError(u);
+ this->OnSyntaxError(u, "");
return MOD_CONT;
}
@@ -203,7 +204,7 @@ class CommandCSOInfo : public Command
return true;
}
- void OnSyntaxError(User *u)
+ void OnSyntaxError(User *u, const ci::string &subcommand)
{
me->NoticeLang(s_ChanServ, u, OCINFO_SYNTAX);
}