summaryrefslogtreecommitdiff
path: root/modules/chanserv
diff options
context:
space:
mode:
Diffstat (limited to 'modules/chanserv')
-rw-r--r--modules/chanserv/access.cpp32
-rw-r--r--modules/chanserv/akick.cpp18
-rw-r--r--modules/chanserv/clone.cpp2
-rw-r--r--modules/chanserv/enforce.cpp2
-rw-r--r--modules/chanserv/entrymsg.cpp4
-rw-r--r--modules/chanserv/flags.cpp2
-rw-r--r--modules/chanserv/list.cpp2
-rw-r--r--modules/chanserv/mode.cpp4
-rw-r--r--modules/chanserv/seen.cpp2
-rw-r--r--modules/chanserv/set.cpp20
-rw-r--r--modules/chanserv/topic.cpp2
-rw-r--r--modules/chanserv/xop.cpp18
12 files changed, 86 insertions, 22 deletions
diff --git a/modules/chanserv/access.cpp b/modules/chanserv/access.cpp
index 886f02778..fd6aad1c5 100644
--- a/modules/chanserv/access.cpp
+++ b/modules/chanserv/access.cpp
@@ -625,6 +625,22 @@ class CommandCSAccess : public Command
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("\037mask\037 \037level\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037mask\037 | \037entry-num\037 | \037list\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class CommandCSLevels : public Command
@@ -873,6 +889,22 @@ class CommandCSLevels : public Command
}
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) override
+ {
+ if (subcommand.equals_ci("SET"))
+ {
+ SubcommandSyntaxError(source, subcommand, "\037privilege\037 \037level\037");
+ }
+ else if (subcommand.equals_ci("DISABLE"))
+ {
+ SubcommandSyntaxError(source, subcommand, "\037privilege\037");
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class CSAccess : public Module
diff --git a/modules/chanserv/akick.cpp b/modules/chanserv/akick.cpp
index bbdd614e5..b099c48ac 100644
--- a/modules/chanserv/akick.cpp
+++ b/modules/chanserv/akick.cpp
@@ -599,7 +599,7 @@ class CommandCSAKick : public Command
else if (cmd.equals_ci("CLEAR"))
this->DoClear(source, ci);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -678,6 +678,22 @@ class CommandCSAKick : public Command
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037nick\037 | \037mask\037} [\037reason\037]"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037nick\037 | \037mask\037 | \037entry-num\037 | \037list\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class CSAKick : public Module
diff --git a/modules/chanserv/clone.cpp b/modules/chanserv/clone.cpp
index 341d80944..a5af50743 100644
--- a/modules/chanserv/clone.cpp
+++ b/modules/chanserv/clone.cpp
@@ -198,7 +198,7 @@ public:
}
else
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
return;
}
diff --git a/modules/chanserv/enforce.cpp b/modules/chanserv/enforce.cpp
index c9ca14acf..d31cb8ce7 100644
--- a/modules/chanserv/enforce.cpp
+++ b/modules/chanserv/enforce.cpp
@@ -271,7 +271,7 @@ class CommandCSEnforce : public Command
else if (what.equals_ci("LIMIT"))
this->DoLimit(source, ci);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/chanserv/entrymsg.cpp b/modules/chanserv/entrymsg.cpp
index efcea8e9d..f7beca19f 100644
--- a/modules/chanserv/entrymsg.cpp
+++ b/modules/chanserv/entrymsg.cpp
@@ -241,13 +241,13 @@ class CommandEntryMessage : public Command
else if (params[1].equals_ci("CLEAR"))
this->DoClear(source, ci);
else if (params.size() < 3)
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
else if (params[1].equals_ci("ADD"))
this->DoAdd(source, ci, params[2]);
else if (params[1].equals_ci("DEL"))
this->DoDel(source, ci, params[2]);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/chanserv/flags.cpp b/modules/chanserv/flags.cpp
index ecd8ba9d3..c1ebe412f 100644
--- a/modules/chanserv/flags.cpp
+++ b/modules/chanserv/flags.cpp
@@ -101,7 +101,7 @@ class CommandCSFlags : public Command
{
if (flags.empty())
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
return;
}
diff --git a/modules/chanserv/list.cpp b/modules/chanserv/list.cpp
index 1f89b0274..972099610 100644
--- a/modules/chanserv/list.cpp
+++ b/modules/chanserv/list.cpp
@@ -229,7 +229,7 @@ class CommandCSSetPrivate : public Command
}
else
{
- this->OnSyntaxError(source, "PRIVATE");
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/chanserv/mode.cpp b/modules/chanserv/mode.cpp
index b1639baa0..e72273397 100644
--- a/modules/chanserv/mode.cpp
+++ b/modules/chanserv/mode.cpp
@@ -486,7 +486,7 @@ class CommandCSMode : public Command
}
else
{
- this->OnSyntaxError(source, subcommand);
+ this->OnSyntaxError(source);
}
}
@@ -755,7 +755,7 @@ class CommandCSMode : public Command
}
else
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/chanserv/seen.cpp b/modules/chanserv/seen.cpp
index db52f269e..87c8c9907 100644
--- a/modules/chanserv/seen.cpp
+++ b/modules/chanserv/seen.cpp
@@ -153,7 +153,7 @@ class CommandOSSeen : public Command
time_t time = 0;
if ((params.size() < 2) || (0 >= (time = Anope::DoTime(params[1]))))
{
- this->OnSyntaxError(source, params[0]);
+ this->OnSyntaxError(source, "CLEAR");
return;
}
time = Anope::CurTime - time;
diff --git a/modules/chanserv/set.cpp b/modules/chanserv/set.cpp
index dbe17f0ab..c6df83cbe 100644
--- a/modules/chanserv/set.cpp
+++ b/modules/chanserv/set.cpp
@@ -33,7 +33,7 @@ class CommandCSSet : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
@@ -128,7 +128,7 @@ class CommandCSSetAutoOp : public Command
}
else
{
- this->OnSyntaxError(source, "AUTOOP");
+ this->OnSyntaxError(source);
}
}
@@ -401,7 +401,7 @@ class CommandCSSetKeepModes : public Command
}
else
{
- this->OnSyntaxError(source, "KEEPMODES");
+ this->OnSyntaxError(source);
}
}
@@ -466,7 +466,7 @@ class CommandCSSetPeace : public Command
}
else
{
- this->OnSyntaxError(source, "PEACE");
+ this->OnSyntaxError(source);
}
}
@@ -605,7 +605,7 @@ class CommandCSSetPersist : public Command
}
else
{
- this->OnSyntaxError(source, "PERSIST");
+ this->OnSyntaxError(source);
}
}
@@ -671,7 +671,7 @@ class CommandCSSetRestricted : public Command
}
else
{
- this->OnSyntaxError(source, "RESTRICTED");
+ this->OnSyntaxError(source);
}
}
@@ -736,7 +736,7 @@ class CommandCSSetSecureFounder : public Command
}
else
{
- this->OnSyntaxError(source, "SECUREFOUNDER");
+ this->OnSyntaxError(source);
}
}
@@ -806,7 +806,7 @@ class CommandCSSetSecureOps : public Command
}
else
{
- this->OnSyntaxError(source, "SECUREOPS");
+ this->OnSyntaxError(source);
}
}
@@ -882,7 +882,7 @@ class CommandCSSetSignKick : public Command
}
else
{
- this->OnSyntaxError(source, "SIGNKICK");
+ this->OnSyntaxError(source);
}
}
@@ -1024,7 +1024,7 @@ class CommandCSSetNoexpire : public Command
}
else
{
- this->OnSyntaxError(source, "NOEXPIRE");
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/chanserv/topic.cpp b/modules/chanserv/topic.cpp
index 85bcf1426..d103307ce 100644
--- a/modules/chanserv/topic.cpp
+++ b/modules/chanserv/topic.cpp
@@ -76,7 +76,7 @@ class CommandCSSetKeepTopic : public Command
}
else
{
- this->OnSyntaxError(source, "KEEPTOPIC");
+ this->OnSyntaxError(source);
}
}
diff --git a/modules/chanserv/xop.cpp b/modules/chanserv/xop.cpp
index 26de3ec41..ad6990a9a 100644
--- a/modules/chanserv/xop.cpp
+++ b/modules/chanserv/xop.cpp
@@ -479,7 +479,7 @@ class CommandCSXOP : public Command
else if (cmd.equals_ci("CLEAR"))
return this->DoClear(source, ci);
else
- this->OnSyntaxError(source, "");
+ this->OnSyntaxError(source);
}
@@ -574,6 +574,22 @@ class CommandCSXOP : public Command
}
return true;
}
+
+ void OnSyntaxError(CommandSource &source, const Anope::string &subcommand = "") override
+ {
+ if (subcommand.equals_ci("ADD"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("\037channel\037 ADD \037mask\037"));
+ }
+ else if (subcommand.equals_ci("DEL"))
+ {
+ SubcommandSyntaxError(source, subcommand, _("{\037mask\037 | \037entry-num\037 | \037list\037}"));
+ }
+ else
+ {
+ Command::OnSyntaxError(source, subcommand);
+ }
+ }
};
class CSXOP : public Module