summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/core/bs_bot.cpp6
-rw-r--r--modules/core/cs_list.cpp6
-rw-r--r--modules/core/cs_saset.cpp10
-rw-r--r--modules/core/cs_saset_noexpire.cpp4
-rw-r--r--modules/core/cs_set.cpp8
-rw-r--r--modules/core/cs_set_bantype.cpp6
-rw-r--r--modules/core/cs_set_description.cpp6
-rw-r--r--modules/core/cs_set_founder.cpp10
-rw-r--r--modules/core/cs_set_keeptopic.cpp6
-rw-r--r--modules/core/cs_set_opnotice.cpp6
-rw-r--r--modules/core/cs_set_peace.cpp6
-rw-r--r--modules/core/cs_set_persist.cpp6
-rw-r--r--modules/core/cs_set_private.cpp6
-rw-r--r--modules/core/cs_set_restricted.cpp6
-rw-r--r--modules/core/cs_set_secure.cpp6
-rw-r--r--modules/core/cs_set_securefounder.cpp6
-rw-r--r--modules/core/cs_set_secureops.cpp6
-rw-r--r--modules/core/cs_set_signkick.cpp6
-rw-r--r--modules/core/cs_set_successor.cpp10
-rw-r--r--modules/core/cs_set_topiclock.cpp6
-rw-r--r--modules/core/cs_suspend.cpp4
-rw-r--r--modules/core/db_mysql.cpp2
-rw-r--r--modules/core/gl_global.cpp2
-rw-r--r--modules/core/help.cpp40
-rw-r--r--modules/core/hs_del.cpp4
-rw-r--r--modules/core/hs_list.cpp2
-rw-r--r--modules/core/hs_set.cpp4
-rw-r--r--modules/core/ms_sendall.cpp2
-rw-r--r--modules/core/ms_staff.cpp2
-rw-r--r--modules/core/ns_getemail.cpp2
-rw-r--r--modules/core/ns_getpass.cpp2
-rw-r--r--modules/core/ns_list.cpp6
-rw-r--r--modules/core/ns_saset.cpp15
-rw-r--r--modules/core/ns_saset_noexpire.cpp2
-rw-r--r--modules/core/ns_set.cpp11
-rw-r--r--modules/core/ns_set_autoop.cpp4
-rw-r--r--modules/core/ns_set_email.cpp4
-rw-r--r--modules/core/ns_set_greet.cpp4
-rw-r--r--modules/core/ns_set_hide.cpp4
-rw-r--r--modules/core/ns_set_kill.cpp4
-rw-r--r--modules/core/ns_set_language.cpp4
-rw-r--r--modules/core/ns_set_message.cpp4
-rw-r--r--modules/core/ns_set_private.cpp4
-rw-r--r--modules/core/ns_set_secure.cpp4
-rw-r--r--modules/core/ns_suspend.cpp4
-rw-r--r--modules/core/os_akill.cpp2
-rw-r--r--modules/core/os_chankill.cpp2
-rw-r--r--modules/core/os_config.cpp2
-rw-r--r--modules/core/os_forbid.cpp2
-rw-r--r--modules/core/os_ignore.cpp2
-rw-r--r--modules/core/os_jupe.cpp2
-rw-r--r--modules/core/os_kick.cpp2
-rw-r--r--modules/core/os_kill.cpp2
-rw-r--r--modules/core/os_mode.cpp4
-rw-r--r--modules/core/os_modinfo.cpp10
-rw-r--r--modules/core/os_module.cpp6
-rw-r--r--modules/core/os_news.cpp2
-rw-r--r--modules/core/os_noop.cpp2
-rw-r--r--modules/core/os_oline.cpp2
-rw-r--r--modules/core/os_oper.cpp2
-rw-r--r--modules/core/os_reload.cpp2
-rw-r--r--modules/core/os_session.cpp2
-rw-r--r--modules/core/os_set.cpp2
-rw-r--r--modules/core/os_shutdown.cpp6
-rw-r--r--modules/core/os_stats.cpp2
-rw-r--r--modules/core/os_svsnick.cpp2
-rw-r--r--modules/core/os_sxline.cpp8
-rw-r--r--modules/core/os_update.cpp2
-rw-r--r--modules/extra/cs_set_misc.cpp4
-rw-r--r--modules/extra/hs_request.cpp6
-rw-r--r--modules/extra/m_async_commands.cpp2
-rw-r--r--modules/extra/ns_set_misc.cpp4
-rw-r--r--modules/extra/os_defcon.cpp2
73 files changed, 185 insertions, 175 deletions
diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp
index ec0bea734..7500d1926 100644
--- a/modules/core/bs_bot.cpp
+++ b/modules/core/bs_bot.cpp
@@ -314,7 +314,7 @@ class CommandBSBot : public Command
if (cmd.equals_ci("ADD"))
{
// ADD nick user host real - 5
- if (!u->HasCommand("botserv/botserv/bot/add"))
+ if (!u->HasCommand("botserv/bot/add"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -337,7 +337,7 @@ class CommandBSBot : public Command
{
// CHANGE oldn newn user host real - 6
// but only oldn and newn are required
- if (!u->HasCommand("botserv/botserv/bot/change"))
+ if (!u->HasCommand("botserv/bot/change"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -354,7 +354,7 @@ class CommandBSBot : public Command
else if (cmd.equals_ci("DEL"))
{
// DEL nick
- if (!u->HasCommand("botserv/botserv/bot/del"))
+ if (!u->HasCommand("botserv/bot/del"))
{
source.Reply(ACCESS_DENIED);
return;
diff --git a/modules/core/cs_list.cpp b/modules/core/cs_list.cpp
index 639c23267..a79c047c4 100644
--- a/modules/core/cs_list.cpp
+++ b/modules/core/cs_list.cpp
@@ -33,12 +33,6 @@ class CommandCSList : public Command
int count = 0, from = 0, to = 0;
bool suspended = false, channoexpire = false;
- if (Config->CSListOpersOnly && !u->HasMode(UMODE_OPER))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
if (pattern[0] == '#')
{
Anope::string n1 = myStrGetToken(pattern.substr(1), '-', 0), /* Read FROM out */
diff --git a/modules/core/cs_saset.cpp b/modules/core/cs_saset.cpp
index cb749a3c3..699c5bc2c 100644
--- a/modules/core/cs_saset.cpp
+++ b/modules/core/cs_saset.cpp
@@ -16,7 +16,7 @@
class CommandCSSASet : public Command
{
public:
- CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3, "chanserv/saset")
+ CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3)
{
this->SetDesc(_("Forcefully set channel options and information"));
this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037"));
@@ -37,11 +37,13 @@ class CommandCSSASet : public Command
" \n"
"Available options:"));
Anope::string this_name = source.command;
- for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
+ for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
- if (it->first.find_ci(this_name + " ") == 0)
+ const Anope::string &c_name = it->first;
+ CommandInfo &info = it->second;
+ if (c_name.find_ci(this_name + " ") == 0)
{
- service_reference<Command> command(it->second);
+ service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
diff --git a/modules/core/cs_saset_noexpire.cpp b/modules/core/cs_saset_noexpire.cpp
index 4a1caa449..1e085496f 100644
--- a/modules/core/cs_saset_noexpire.cpp
+++ b/modules/core/cs_saset_noexpire.cpp
@@ -16,7 +16,7 @@
class CommandCSSASetNoexpire : public Command
{
public:
- CommandCSSASetNoexpire(Module *creator) : Command(creator, "chanserv/saset/noexpire", 2, 2, "chanserv/saset/noexpire")
+ CommandCSSASetNoexpire(Module *creator) : Command(creator, "chanserv/saset/noexpire", 2, 2)
{
this->SetDesc(_("Prevent the channel from expiring"));
this->SetDesc(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSASetNoexpire : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
diff --git a/modules/core/cs_set.cpp b/modules/core/cs_set.cpp
index 8b5ca1f61..65719ce91 100644
--- a/modules/core/cs_set.cpp
+++ b/modules/core/cs_set.cpp
@@ -37,11 +37,13 @@ class CommandCSSet : public Command
" \n"
"Available options:"));
Anope::string this_name = source.command;
- for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
+ for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
- if (it->first.find_ci(this_name + " ") == 0)
+ const Anope::string &c_name = it->first;
+ CommandInfo &info = it->second;
+ if (c_name.find_ci(this_name + " ") == 0)
{
- service_reference<Command> command(it->second);
+ service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
diff --git a/modules/core/cs_set_bantype.cpp b/modules/core/cs_set_bantype.cpp
index 14b13a77b..94d2aa151 100644
--- a/modules/core/cs_set_bantype.cpp
+++ b/modules/core/cs_set_bantype.cpp
@@ -16,7 +16,7 @@
class CommandCSSetBanType : public Command
{
public:
- CommandCSSetBanType(Module *creator, const Anope::string &cname = "chanserv/set/bantype", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetBanType(Module *creator, const Anope::string &cname = "chanserv/set/bantype") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set how Services make bans on the channel"));
this->SetSyntax(_("\037channel\037 \037bantype\037"));
@@ -32,7 +32,7 @@ class CommandCSSetBanType : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -74,7 +74,7 @@ class CommandCSSetBanType : public Command
class CommandCSSASetBanType : public CommandCSSetBanType
{
public:
- CommandCSSASetBanType(Module *creator) : CommandCSSetBanType(creator, "chanserv/saset/bantype", "chanserv/saset/bantype")
+ CommandCSSASetBanType(Module *creator) : CommandCSSetBanType(creator, "chanserv/saset/bantype")
{
}
};
diff --git a/modules/core/cs_set_description.cpp b/modules/core/cs_set_description.cpp
index 3282f8144..5c2cd447d 100644
--- a/modules/core/cs_set_description.cpp
+++ b/modules/core/cs_set_description.cpp
@@ -16,7 +16,7 @@
class CommandCSSetDescription : public Command
{
public:
- CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
+ CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description") : Command(creator, cname, 1, 2)
{
this->SetDesc(_("Set the channel description"));
this->SetSyntax(_("\037channel\037 [\037description\037]"));
@@ -32,7 +32,7 @@ class CommandCSSetDescription : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -65,7 +65,7 @@ class CommandCSSetDescription : public Command
class CommandCSSASetDescription : public CommandCSSetDescription
{
public:
- CommandCSSASetDescription(Module *creator) : CommandCSSetDescription(creator, "chanserv/saset/description", "chanserv/saset/description")
+ CommandCSSASetDescription(Module *creator) : CommandCSSetDescription(creator, "chanserv/saset/description")
{
}
};
diff --git a/modules/core/cs_set_founder.cpp b/modules/core/cs_set_founder.cpp
index e71fd4d3e..2169af972 100644
--- a/modules/core/cs_set_founder.cpp
+++ b/modules/core/cs_set_founder.cpp
@@ -16,7 +16,7 @@
class CommandCSSetFounder : public Command
{
public:
- CommandCSSetFounder(Module *creator, const Anope::string &cname = "chanserv/set/founder", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetFounder(Module *creator, const Anope::string &cname = "chanserv/set/founder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set the founder of a channel"));
this->SetSyntax(_("\037channel\037 \037nick\037"));
@@ -32,13 +32,13 @@ class CommandCSSetFounder : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
}
- if (this->permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)))
+ if (source.permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)))
{
source.Reply(ACCESS_DENIED);
return;
@@ -59,7 +59,7 @@ class CommandCSSetFounder : public Command
return;
}
- Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
+ Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
ci->SetFounder(nc);
@@ -81,7 +81,7 @@ class CommandCSSetFounder : public Command
class CommandCSSASetFounder : public CommandCSSetFounder
{
public:
- CommandCSSASetFounder(Module *creator) : CommandCSSetFounder(creator, "chanserv/saset/founder", "chanserv/saset/founder")
+ CommandCSSASetFounder(Module *creator) : CommandCSSetFounder(creator, "chanserv/saset/founder")
{
}
};
diff --git a/modules/core/cs_set_keeptopic.cpp b/modules/core/cs_set_keeptopic.cpp
index 0322987e4..05578a2e5 100644
--- a/modules/core/cs_set_keeptopic.cpp
+++ b/modules/core/cs_set_keeptopic.cpp
@@ -16,7 +16,7 @@
class CommandCSSetKeepTopic : public Command
{
public:
- CommandCSSetKeepTopic(Module *creator, const Anope::string &cname = "chanserv/set/keeptopic", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetKeepTopic(Module *creator, const Anope::string &cname = "chanserv/set/keeptopic") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Retain topic when channel is not in use"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetKeepTopic : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -70,7 +70,7 @@ class CommandCSSetKeepTopic : public Command
class CommandCSSASetKeepTopic : public CommandCSSetKeepTopic
{
public:
- CommandCSSASetKeepTopic(Module *creator) : CommandCSSetKeepTopic(creator, "chanserv/saset/keeptopic", "chanserv/saset/keeptopic")
+ CommandCSSASetKeepTopic(Module *creator) : CommandCSSetKeepTopic(creator, "chanserv/saset/keeptopic")
{
}
};
diff --git a/modules/core/cs_set_opnotice.cpp b/modules/core/cs_set_opnotice.cpp
index cfcaf358c..018b89437 100644
--- a/modules/core/cs_set_opnotice.cpp
+++ b/modules/core/cs_set_opnotice.cpp
@@ -16,7 +16,7 @@
class CommandCSSetOpNotice : public Command
{
public:
- CommandCSSetOpNotice(Module *creator, const Anope::string &cname = "chanserv/set/notice", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetOpNotice(Module *creator, const Anope::string &cname = "chanserv/set/notice") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Send a notice when OP/DEOP commands are used"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetOpNotice : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetOpNotice : public Command
class CommandCSSASetOpNotice : public CommandCSSetOpNotice
{
public:
- CommandCSSASetOpNotice(Module *creator) : CommandCSSetOpNotice(creator, "chanserv/saset/opnotice", "chanserv/saset/opnotice")
+ CommandCSSASetOpNotice(Module *creator) : CommandCSSetOpNotice(creator, "chanserv/saset/opnotice")
{
}
};
diff --git a/modules/core/cs_set_peace.cpp b/modules/core/cs_set_peace.cpp
index cb208e540..3a045fc6d 100644
--- a/modules/core/cs_set_peace.cpp
+++ b/modules/core/cs_set_peace.cpp
@@ -16,7 +16,7 @@
class CommandCSSetPeace : public Command
{
public:
- CommandCSSetPeace(Module *creator, const Anope::string &cname = "chanserv/set/peace", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetPeace(Module *creator, const Anope::string &cname = "chanserv/set/peace") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Regulate the use of critical commands"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPeace : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetPeace : public Command
class CommandCSSASetPeace : public CommandCSSetPeace
{
public:
- CommandCSSASetPeace(Module *creator) : CommandCSSetPeace(creator, "chanserv/saset/peace", "chanserv/saset/peace")
+ CommandCSSASetPeace(Module *creator) : CommandCSSetPeace(creator, "chanserv/saset/peace")
{
}
};
diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp
index 2402a3370..3cc9564c4 100644
--- a/modules/core/cs_set_persist.cpp
+++ b/modules/core/cs_set_persist.cpp
@@ -16,7 +16,7 @@
class CommandCSSetPersist : public Command
{
public:
- CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set the channel as permanent"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPersist : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -156,7 +156,7 @@ class CommandCSSetPersist : public Command
class CommandCSSASetPersist : public CommandCSSetPersist
{
public:
- CommandCSSASetPersist(Module *creator) : CommandCSSetPersist(creator, "chanserv/saset/persist", "chanserv/saset/persist")
+ CommandCSSASetPersist(Module *creator) : CommandCSSetPersist(creator, "chanserv/saset/persist")
{
}
};
diff --git a/modules/core/cs_set_private.cpp b/modules/core/cs_set_private.cpp
index 85880d5da..108b11569 100644
--- a/modules/core/cs_set_private.cpp
+++ b/modules/core/cs_set_private.cpp
@@ -16,7 +16,7 @@
class CommandCSSetPrivate : public Command
{
public:
- CommandCSSetPrivate(Module *creator, const Anope::string &cname = "chanserv/set/private", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetPrivate(Module *creator, const Anope::string &cname = "chanserv/set/private") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Hide channel from LIST command"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPrivate : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetPrivate : public Command
class CommandCSSASetPrivate : public CommandCSSetPrivate
{
public:
- CommandCSSASetPrivate(Module *creator) : CommandCSSetPrivate(creator, "chanserv/saset/private", "chanserv/saset/private")
+ CommandCSSASetPrivate(Module *creator) : CommandCSSetPrivate(creator, "chanserv/saset/private")
{
}
};
diff --git a/modules/core/cs_set_restricted.cpp b/modules/core/cs_set_restricted.cpp
index 9796c97da..5d675d2e7 100644
--- a/modules/core/cs_set_restricted.cpp
+++ b/modules/core/cs_set_restricted.cpp
@@ -15,7 +15,7 @@
class CommandCSSetRestricted : public Command
{
public:
- CommandCSSetRestricted(Module *creator, const Anope::string &cname = "chanserv/set/restricted", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetRestricted(Module *creator, const Anope::string &cname = "chanserv/set/restricted") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Restrict access to the channel"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -31,7 +31,7 @@ class CommandCSSetRestricted : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -67,7 +67,7 @@ class CommandCSSetRestricted : public Command
class CommandCSSASetRestricted : public CommandCSSetRestricted
{
public:
- CommandCSSASetRestricted(Module *creator) : CommandCSSetRestricted(creator, "chanserv/saset/restricted", "chanserv/saset/restricted")
+ CommandCSSASetRestricted(Module *creator) : CommandCSSetRestricted(creator, "chanserv/saset/restricted")
{
}
};
diff --git a/modules/core/cs_set_secure.cpp b/modules/core/cs_set_secure.cpp
index 2042ed7b9..26e8c5768 100644
--- a/modules/core/cs_set_secure.cpp
+++ b/modules/core/cs_set_secure.cpp
@@ -16,7 +16,7 @@
class CommandCSSetSecure : public Command
{
public:
- CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Activate security features"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSecure : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -70,7 +70,7 @@ class CommandCSSetSecure : public Command
class CommandCSSASetSecure : public CommandCSSetSecure
{
public:
- CommandCSSASetSecure(Module *creator) : CommandCSSetSecure(creator, "chanserv/saset/secure", "chanserv/saset/secure")
+ CommandCSSASetSecure(Module *creator) : CommandCSSetSecure(creator, "chanserv/saset/secure")
{
}
};
diff --git a/modules/core/cs_set_securefounder.cpp b/modules/core/cs_set_securefounder.cpp
index 6e11bbce4..7afc2e32d 100644
--- a/modules/core/cs_set_securefounder.cpp
+++ b/modules/core/cs_set_securefounder.cpp
@@ -16,7 +16,7 @@
class CommandCSSetSecureFounder : public Command
{
public:
- CommandCSSetSecureFounder(Module *creator, const Anope::string &cname = "chanserv/set/securefounder", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetSecureFounder(Module *creator, const Anope::string &cname = "chanserv/set/securefounder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of channel founder status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -33,7 +33,7 @@ class CommandCSSetSecureFounder : public Command
}
- if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
+ if (source.permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
return;
@@ -71,7 +71,7 @@ class CommandCSSetSecureFounder : public Command
class CommandCSSASetSecureFounder : public CommandCSSetSecureFounder
{
public:
- CommandCSSASetSecureFounder(Module *creator) : CommandCSSetSecureFounder(creator, "chanserv/saset/securefounder", "chanserv/saset/securefounder")
+ CommandCSSASetSecureFounder(Module *creator) : CommandCSSetSecureFounder(creator, "chanserv/saset/securefounder")
{
}
};
diff --git a/modules/core/cs_set_secureops.cpp b/modules/core/cs_set_secureops.cpp
index ed15f7cb5..4c3c54b05 100644
--- a/modules/core/cs_set_secureops.cpp
+++ b/modules/core/cs_set_secureops.cpp
@@ -16,7 +16,7 @@
class CommandCSSetSecureOps : public Command
{
public:
- CommandCSSetSecureOps(Module *creator, const Anope::string &cname = "chanserv/set/secureops", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetSecureOps(Module *creator, const Anope::string &cname = "chanserv/set/secureops") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of chanop status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSecureOps : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -68,7 +68,7 @@ class CommandCSSetSecureOps : public Command
class CommandCSSASetSecureOps : public CommandCSSetSecureOps
{
public:
- CommandCSSASetSecureOps(Module *creator) : CommandCSSetSecureOps(creator, "chanserv/saset/secureops", "chanserv/saset/secureops")
+ CommandCSSASetSecureOps(Module *creator) : CommandCSSetSecureOps(creator, "chanserv/saset/secureops")
{
}
};
diff --git a/modules/core/cs_set_signkick.cpp b/modules/core/cs_set_signkick.cpp
index 38894b62b..0d421576d 100644
--- a/modules/core/cs_set_signkick.cpp
+++ b/modules/core/cs_set_signkick.cpp
@@ -16,7 +16,7 @@
class CommandCSSetSignKick : public Command
{
public:
- CommandCSSetSignKick(Module *creator, const Anope::string &cname = "chanserv/set/signkick", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetSignKick(Module *creator, const Anope::string &cname = "chanserv/set/signkick") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Sign kicks that are done with KICK command"));
this->SetSyntax(_("\037channel\037 SIGNKICK {ON | LEVEL | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSignKick : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -80,7 +80,7 @@ class CommandCSSetSignKick : public Command
class CommandCSSASetSignKick : public CommandCSSetSignKick
{
public:
- CommandCSSASetSignKick(Module *creator) : CommandCSSetSignKick(creator, "chanserv/saset/signkick", "chanserv/saset/signkick")
+ CommandCSSASetSignKick(Module *creator) : CommandCSSetSignKick(creator, "chanserv/saset/signkick")
{
}
};
diff --git a/modules/core/cs_set_successor.cpp b/modules/core/cs_set_successor.cpp
index a1c756b5d..f7ed8dba9 100644
--- a/modules/core/cs_set_successor.cpp
+++ b/modules/core/cs_set_successor.cpp
@@ -16,7 +16,7 @@
class CommandCSSetSuccessor : public Command
{
public:
- CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
+ CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor") : Command(creator, cname, 1, 2)
{
this->SetDesc(_("Set the successor for a channel"));
this->SetSyntax(_("\037channel\037 \037nick\037"));
@@ -32,13 +32,13 @@ class CommandCSSetSuccessor : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
}
- if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
+ if (source.permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
return;
@@ -65,7 +65,7 @@ class CommandCSSetSuccessor : public Command
else
nc = NULL;
- Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none");
+ Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none");
ci->successor = nc;
@@ -95,7 +95,7 @@ class CommandCSSetSuccessor : public Command
class CommandCSSASetSuccessor : public CommandCSSetSuccessor
{
public:
- CommandCSSASetSuccessor(Module *creator) : CommandCSSetSuccessor(creator, "chanserv/saset/successor", "chanserv/saset/successor")
+ CommandCSSASetSuccessor(Module *creator) : CommandCSSetSuccessor(creator, "chanserv/saset/successor")
{
}
};
diff --git a/modules/core/cs_set_topiclock.cpp b/modules/core/cs_set_topiclock.cpp
index 3dea981f6..e670385ba 100644
--- a/modules/core/cs_set_topiclock.cpp
+++ b/modules/core/cs_set_topiclock.cpp
@@ -16,7 +16,7 @@
class CommandCSSetTopicLock : public Command
{
public:
- CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Topic can only be changed with TOPIC"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetTopicLock : public Command
return;
}
- if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
+ if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -68,7 +68,7 @@ class CommandCSSetTopicLock : public Command
class CommandCSSASetTopicLock : public CommandCSSetTopicLock
{
public:
- CommandCSSASetTopicLock(Module *creator) : CommandCSSetTopicLock(creator, "chanserv/saset/topiclock", "chanserv/saset/topiclock")
+ CommandCSSASetTopicLock(Module *creator) : CommandCSSetTopicLock(creator, "chanserv/saset/topiclock")
{
}
};
diff --git a/modules/core/cs_suspend.cpp b/modules/core/cs_suspend.cpp
index 0e0a72bcf..d59ffb44b 100644
--- a/modules/core/cs_suspend.cpp
+++ b/modules/core/cs_suspend.cpp
@@ -16,7 +16,7 @@
class CommandCSSuspend : public Command
{
public:
- CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 2, "chanserv/suspend")
+ CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 2)
{
this->SetDesc(_("Prevent a channel from being used preserving channel data and settings"));
this->SetSyntax(_("\037channel\037 [\037reason\037]"));
@@ -86,7 +86,7 @@ class CommandCSSuspend : public Command
class CommandCSUnSuspend : public Command
{
public:
- CommandCSUnSuspend(Module *creator) : Command(creator, "chanserv/unsuspend", 1, 1, "chanserv/suspend")
+ CommandCSUnSuspend(Module *creator) : Command(creator, "chanserv/unsuspend", 1, 1)
{
this->SetDesc(_("Releases a suspended channel"));
this->SetSyntax(_("\037channel\037"));
diff --git a/modules/core/db_mysql.cpp b/modules/core/db_mysql.cpp
index 3f18230fe..4e6a7de4f 100644
--- a/modules/core/db_mysql.cpp
+++ b/modules/core/db_mysql.cpp
@@ -52,7 +52,7 @@ static void WriteBotMetadata(const Anope::string &key, const Anope::string &data
class CommandSQLSync : public Command
{
public:
- CommandSQLSync(Module *creator) : Command(creator, "SQLSYNC", 0, 0, "operserv/sqlsync")
+ CommandSQLSync(Module *creator) : Command(creator, "SQLSYNC", 0, 0)
{
this->SetDesc(_("Import your databases to SQL"));
this->SetSyntax("");
diff --git a/modules/core/gl_global.cpp b/modules/core/gl_global.cpp
index 390d912ef..80c42e017 100644
--- a/modules/core/gl_global.cpp
+++ b/modules/core/gl_global.cpp
@@ -17,7 +17,7 @@
class CommandGLGlobal : public Command
{
public:
- CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1, "global/global")
+ CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1)
{
this->SetDesc(_("Send a message to all users"));
this->SetSyntax(_("\037message\037"));
diff --git a/modules/core/help.cpp b/modules/core/help.cpp
index 8362b48d9..2a4f25b6c 100644
--- a/modules/core/help.cpp
+++ b/modules/core/help.cpp
@@ -32,19 +32,22 @@ class CommandHelp : public Command
if (params.empty())
{
- for (command_map::iterator it = bi->commands.begin(), it_end = bi->commands.end(); it != it_end; ++it)
+ for (BotInfo::command_map::iterator it = bi->commands.begin(), it_end = bi->commands.end(); it != it_end; ++it)
{
+ const Anope::string &c_name = it->first;
+ CommandInfo &info = it->second;
+
// Smaller command exists
- Anope::string cmd = myStrGetToken(it->first, ' ', 0);
+ Anope::string cmd = myStrGetToken(c_name, ' ', 0);
if (cmd != it->first && bi->commands.count(cmd))
continue;
- service_reference<Command> c(it->second);
+ service_reference<Command> c(info.name);
if (!c)
continue;
- if (!Config->HidePrivilegedCommands || c->permission.empty() || u->HasCommand(c->permission))
+ if (!Config->HidePrivilegedCommands || info.permission.empty() || u->HasCommand(info.permission))
{
- source.command = it->first;
+ source.command = c_name;
c->OnServHelp(source);
}
}
@@ -59,15 +62,17 @@ class CommandHelp : public Command
full_command += " " + params[i];
full_command.erase(full_command.begin());
- std::map<Anope::string, Anope::string>::iterator it = bi->commands.find(full_command);
+ BotInfo::command_map::iterator it = bi->commands.find(full_command);
if (it == bi->commands.end())
continue;
- service_reference<Command> c(it->second);
+ CommandInfo &info = it->second;
+
+ service_reference<Command> c(info.name);
if (!c)
continue;
- if (Config->HidePrivilegedCommands && !c->permission.empty() && !u->HasCommand(c->permission))
+ if (Config->HidePrivilegedCommands && !info.permission.empty() && !u->HasCommand(info.permission))
continue;
const Anope::string &subcommand = params.size() > max ? params[max] : "";
@@ -76,19 +81,24 @@ class CommandHelp : public Command
continue;
helped = true;
- source.Reply(" ");
/* Inform the user what permission is required to use the command */
- if (!c->permission.empty())
- source.Reply(_("Access to this command requires the permission \002%s\002 to be present in your opertype."), c->permission.c_str());
+ if (!info.permission.empty())
+ {
+ source.Reply(" ");
+ source.Reply(_("Access to this command requires the permission \002%s\002 to be present in your opertype."), info.permission.c_str());
+ }
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified())
+ {
+ if (info.permission.empty())
+ source.Reply(" ");
source.Reply( _("You need to be identified to use this command."));
+ }
/* User doesn't have the proper permission to use this command */
- else if (!c->permission.empty() && !u->HasCommand(c->permission))
+ else if (!info.permission.empty() && !u->HasCommand(info.permission))
+ {
source.Reply(_("You cannot use this command."));
- /* User can use this command */
- else
- source.Reply(_("You can use this command."));
+ }
break;
}
diff --git a/modules/core/hs_del.cpp b/modules/core/hs_del.cpp
index b4d101d44..541986aff 100644
--- a/modules/core/hs_del.cpp
+++ b/modules/core/hs_del.cpp
@@ -16,7 +16,7 @@
class CommandHSDel : public Command
{
public:
- CommandHSDel(Module *creator) : Command(creator, "hostserv/del", 1, 1, "hostserv/del")
+ CommandHSDel(Module *creator) : Command(creator, "hostserv/del", 1, 1)
{
this->SetDesc(_("Delete the vhost of another user"));
this->SetSyntax(_("\037nick\037"));
@@ -51,7 +51,7 @@ class CommandHSDel : public Command
class CommandHSDelAll : public Command
{
public:
- CommandHSDelAll(Module *creator) : Command(creator, "hostserv/delall", 1, 1, "hostserv/del")
+ CommandHSDelAll(Module *creator) : Command(creator, "hostserv/delall", 1, 1)
{
this->SetDesc(_("Delete the vhost for all nicks in a group"));
this->SetSyntax(_("\037nick\037"));
diff --git a/modules/core/hs_list.cpp b/modules/core/hs_list.cpp
index dbc852e5b..589eef3e1 100644
--- a/modules/core/hs_list.cpp
+++ b/modules/core/hs_list.cpp
@@ -16,7 +16,7 @@
class CommandHSList : public Command
{
public:
- CommandHSList(Module *creator) : Command(creator, "hostserv/list", 0, 1, "hostserv/list")
+ CommandHSList(Module *creator) : Command(creator, "hostserv/list", 0, 1)
{
this->SetDesc(_("Displays one or more vhost entries."));
this->SetSyntax(_("\002[<key>|<#X-Y>]"));
diff --git a/modules/core/hs_set.cpp b/modules/core/hs_set.cpp
index 2b427983d..4711022db 100644
--- a/modules/core/hs_set.cpp
+++ b/modules/core/hs_set.cpp
@@ -16,7 +16,7 @@
class CommandHSSet : public Command
{
public:
- CommandHSSet(Module *creator) : Command(creator, "hostserv/set", 2, 2, "hostserv/set")
+ CommandHSSet(Module *creator) : Command(creator, "hostserv/set", 2, 2)
{
this->SetDesc(_("Set the vhost of another user"));
this->SetSyntax(_("\037nick\037 \037hostmask\037"));
@@ -123,7 +123,7 @@ class CommandHSSetAll : public Command
}
public:
- CommandHSSetAll(Module *creator) : Command(creator, "hostserv/setall", 2, 2, "hostserv/set")
+ CommandHSSetAll(Module *creator) : Command(creator, "hostserv/setall", 2, 2)
{
this->SetDesc(_("Set the vhost for all nicks in a group"));
this->SetSyntax(_("\037nick\037 \037hostmask>\037"));
diff --git a/modules/core/ms_sendall.cpp b/modules/core/ms_sendall.cpp
index 6a764f829..7af5ac7af 100644
--- a/modules/core/ms_sendall.cpp
+++ b/modules/core/ms_sendall.cpp
@@ -17,7 +17,7 @@
class CommandMSSendAll : public Command
{
public:
- CommandMSSendAll(Module *creator) : Command(creator, "memoserv/sendall", 1, 1, "memoserv/sendall")
+ CommandMSSendAll(Module *creator) : Command(creator, "memoserv/sendall", 1, 1)
{
this->SetDesc(_("Send a memo to all registered users"));
this->SetSyntax(_("\037memo-text\037"));
diff --git a/modules/core/ms_staff.cpp b/modules/core/ms_staff.cpp
index b4fe26f5c..6264dbea4 100644
--- a/modules/core/ms_staff.cpp
+++ b/modules/core/ms_staff.cpp
@@ -17,7 +17,7 @@
class CommandMSStaff : public Command
{
public:
- CommandMSStaff(Module *creator) : Command(creator, "memoserv/staff", 1, 1, "memoserv/staff")
+ CommandMSStaff(Module *creator) : Command(creator, "memoserv/staff", 1, 1)
{
this->SetDesc(_("Send a memo to all opers/admins"));
this->SetSyntax(_("\037memo-text\037"));
diff --git a/modules/core/ns_getemail.cpp b/modules/core/ns_getemail.cpp
index 7519ae6d0..fa27e5174 100644
--- a/modules/core/ns_getemail.cpp
+++ b/modules/core/ns_getemail.cpp
@@ -20,7 +20,7 @@
class CommandNSGetEMail : public Command
{
public:
- CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1, "nickserv/getemail")
+ CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1)
{
this->SetDesc(_("Matches and returns all users that registered using given email"));
this->SetSyntax(_("\037user@email-host\037"));
diff --git a/modules/core/ns_getpass.cpp b/modules/core/ns_getpass.cpp
index ab4bcd4e2..9ebea5263 100644
--- a/modules/core/ns_getpass.cpp
+++ b/modules/core/ns_getpass.cpp
@@ -16,7 +16,7 @@
class CommandNSGetPass : public Command
{
public:
- CommandNSGetPass(Module *creator) : Command(creator, "nickserv/getpass", 1, 1, "nickserv/getpass")
+ CommandNSGetPass(Module *creator) : Command(creator, "nickserv/getpass", 1, 1)
{
this->SetDesc(_("Retrieve the password for a nickname"));
this->SetSyntax(_("\037nickname\037"));
diff --git a/modules/core/ns_list.cpp b/modules/core/ns_list.cpp
index e14983530..96049ba02 100644
--- a/modules/core/ns_list.cpp
+++ b/modules/core/ns_list.cpp
@@ -36,12 +36,6 @@ class CommandNSList : public Command
suspended = nsnoexpire = unconfirmed = false;
- if (Config->NSListOpersOnly && !u->HasMode(UMODE_OPER)) /* reverse the help logic */
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
if (pattern[0] == '#')
{
Anope::string n1 = myStrGetToken(pattern.substr(1), '-', 0), /* Read FROM out */
diff --git a/modules/core/ns_saset.cpp b/modules/core/ns_saset.cpp
index b3f732176..a4aa2f422 100644
--- a/modules/core/ns_saset.cpp
+++ b/modules/core/ns_saset.cpp
@@ -33,14 +33,17 @@ class CommandNSSASet : public Command
this->SendSyntax(source);
source.Reply(_("Sets various nickname options. \037option\037 can be one of:"));
Anope::string this_name = source.command;
- for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
+ for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
- if (it->first.find_ci(this_name + " ") == 0)
+ const Anope::string &c_name = it->first;
+ CommandInfo &info = it->second;
+
+ if (c_name.find_ci(this_name + " ") == 0)
{
- service_reference<Command> command(it->second);
+ service_reference<Command> command(info.name);
if (command)
{
- source.command = it->first;
+ source.command = c_name;
command->OnServHelp(source);
}
}
@@ -55,7 +58,7 @@ class CommandNSSASet : public Command
class CommandNSSASetDisplay : public Command
{
public:
- CommandNSSASetDisplay(Module *creator) : Command(creator, "nickserv/saset/display", 2, 2, "nickserv/saset/display")
+ CommandNSSASetDisplay(Module *creator) : Command(creator, "nickserv/saset/display", 2, 2)
{
this->SetDesc(_("Set the display of the group in Services"));
this->SetSyntax(_("\037nickname\037 \037new-display\037"));
@@ -95,7 +98,7 @@ class CommandNSSASetDisplay : public Command
class CommandNSSASetPassword : public Command
{
public:
- CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2, "nickserv/saset/password")
+ CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2)
{
this->SetDesc(_("Set the nickname password"));
this->SetSyntax(_("\037nickname\037 \037new-password\037"));
diff --git a/modules/core/ns_saset_noexpire.cpp b/modules/core/ns_saset_noexpire.cpp
index 26da7786f..1bff9b461 100644
--- a/modules/core/ns_saset_noexpire.cpp
+++ b/modules/core/ns_saset_noexpire.cpp
@@ -16,7 +16,7 @@
class CommandNSSASetNoexpire : public Command
{
public:
- CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2, "nickserv/saset/noexpire")
+ CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2)
{
this->SetDesc(_("Prevent the nickname from expiring"));
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
diff --git a/modules/core/ns_set.cpp b/modules/core/ns_set.cpp
index 8a419153f..ad7acb5a4 100644
--- a/modules/core/ns_set.cpp
+++ b/modules/core/ns_set.cpp
@@ -34,14 +34,17 @@ class CommandNSSet : public Command
source.Reply(" ");
source.Reply(_("Sets various nickname options. \037option\037 can be one of:"));
Anope::string this_name = source.command;
- for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
+ for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
- if (it->first.find_ci(this_name + " ") == 0)
+ const Anope::string &c_name = it->first;
+ CommandInfo &info = it->second;
+
+ if (c_name.find_ci(this_name + " ") == 0)
{
- service_reference<Command> command(it->second);
+ service_reference<Command> command(info.name);
if (command)
{
- source.command = it->first;
+ source.command = c_name;
command->OnServHelp(source);
}
}
diff --git a/modules/core/ns_set_autoop.cpp b/modules/core/ns_set_autoop.cpp
index a107f7188..ff178141f 100644
--- a/modules/core/ns_set_autoop.cpp
+++ b/modules/core/ns_set_autoop.cpp
@@ -16,7 +16,7 @@
class CommandNSSetAutoOp : public Command
{
public:
- CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Should services op you automatically."));
this->SetSyntax(_("{ON | OFF}"));
@@ -66,7 +66,7 @@ class CommandNSSetAutoOp : public Command
class CommandNSSASetAutoOp : public CommandNSSetAutoOp
{
public:
- CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2, "nickserv/saset/autoop")
+ CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
diff --git a/modules/core/ns_set_email.cpp b/modules/core/ns_set_email.cpp
index 4f4131950..f0914eb51 100644
--- a/modules/core/ns_set_email.cpp
+++ b/modules/core/ns_set_email.cpp
@@ -44,7 +44,7 @@ static bool SendConfirmMail(User *u, BotInfo *bi)
class CommandNSSetEmail : public Command
{
public:
- CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0, const Anope::string &spermission = "") : Command(creator, cname, min, min + 1, spermission)
+ CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0) : Command(creator, cname, min, min + 1)
{
this->SetDesc(_("Associate an E-mail address with your nickname"));
this->SetSyntax(_("\037address\037"));
@@ -122,7 +122,7 @@ class CommandNSSetEmail : public Command
class CommandNSSASetEmail : public CommandNSSetEmail
{
public:
- CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2, "nickserv/saset/email")
+ CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037address\037"));
diff --git a/modules/core/ns_set_greet.cpp b/modules/core/ns_set_greet.cpp
index ab5243724..03bcd3834 100644
--- a/modules/core/ns_set_greet.cpp
+++ b/modules/core/ns_set_greet.cpp
@@ -16,7 +16,7 @@
class CommandNSSetGreet : public Command
{
public:
- CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Associate a greet message with your nickname"));
this->SetSyntax(_("\037message\037"));
@@ -66,7 +66,7 @@ class CommandNSSetGreet : public Command
class CommandNSSASetGreet : public CommandNSSetGreet
{
public:
- CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1, "nickserv/saset/greet")
+ CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037message\037"));
diff --git a/modules/core/ns_set_hide.cpp b/modules/core/ns_set_hide.cpp
index de3a96a1a..e0fb0e85e 100644
--- a/modules/core/ns_set_hide.cpp
+++ b/modules/core/ns_set_hide.cpp
@@ -16,7 +16,7 @@
class CommandNSSetHide : public Command
{
public:
- CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Hide certain pieces of nickname information"));
this->SetSyntax(_("{EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"));
@@ -104,7 +104,7 @@ class CommandNSSetHide : public Command
class CommandNSSASetHide : public CommandNSSetHide
{
public:
- CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3, "nickserv/saset/hide")
+ CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3)
{
this->SetSyntax("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}");
}
diff --git a/modules/core/ns_set_kill.cpp b/modules/core/ns_set_kill.cpp
index 26a23292b..f57a93893 100644
--- a/modules/core/ns_set_kill.cpp
+++ b/modules/core/ns_set_kill.cpp
@@ -16,7 +16,7 @@
class CommandNSSetKill : public Command
{
public:
- CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Turn protection on or off"));
this->SetSyntax(_("{ON | QUICK | IMMED | OFF}"));
@@ -99,7 +99,7 @@ class CommandNSSetKill : public Command
class CommandNSSASetKill : public CommandNSSetKill
{
public:
- CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2, "nickserv/saset/kill")
+ CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2)
{
this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}"));
}
diff --git a/modules/core/ns_set_language.cpp b/modules/core/ns_set_language.cpp
index dcad104c5..3429ad688 100644
--- a/modules/core/ns_set_language.cpp
+++ b/modules/core/ns_set_language.cpp
@@ -16,7 +16,7 @@
class CommandNSSetLanguage : public Command
{
public:
- CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Set the language Services will use when messaging you"));
this->SetSyntax(_("\037language\037"));
@@ -79,7 +79,7 @@ class CommandNSSetLanguage : public Command
class CommandNSSASetLanguage : public CommandNSSetLanguage
{
public:
- CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2, "nickserv/saset/language")
+ CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037language\037"));
diff --git a/modules/core/ns_set_message.cpp b/modules/core/ns_set_message.cpp
index fa9c7ae18..677002c78 100644
--- a/modules/core/ns_set_message.cpp
+++ b/modules/core/ns_set_message.cpp
@@ -16,7 +16,7 @@
class CommandNSSetMessage : public Command
{
public:
- CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Change the communication method of Services"));
this->SetSyntax(_("{ON | OFF}"));
@@ -73,7 +73,7 @@ class CommandNSSetMessage : public Command
class CommandNSSASetMessage : public CommandNSSetMessage
{
public:
- CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2, "nickserv/saset/message")
+ CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
diff --git a/modules/core/ns_set_private.cpp b/modules/core/ns_set_private.cpp
index 6e2948067..63fec57d6 100644
--- a/modules/core/ns_set_private.cpp
+++ b/modules/core/ns_set_private.cpp
@@ -16,7 +16,7 @@
class CommandNSSetPrivate : public Command
{
public:
- CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
+ CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(Anope::printf(_("Prevent the nickname from appearing in a \002%s%s LIST\002"), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str()));
this->SetSyntax(_("{ON | OFF}"));
@@ -70,7 +70,7 @@ class CommandNSSetPrivate : public Command
class CommandNSSASetPrivate : public CommandNSSetPrivate
{
public:
- CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2, "nickserv/saset/private")
+ CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
diff --git a/modules/core/ns_set_secure.cpp b/modules/core/ns_set_secure.cpp
index 35baeec3b..31314a5a5 100644
--- a/modules/core/ns_set_secure.cpp
+++ b/modules/core/ns_set_secure.cpp
@@ -16,7 +16,7 @@
class CommandNSSetSecure : public Command
{
public:
- CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1, const Anope::string &cpermission = "") : Command(creator, sname, min, min + 1, cpermission)
+ CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Turn nickname security on or off"));
this->SetSyntax(_("{ON | OFF}"));
@@ -69,7 +69,7 @@ class CommandNSSetSecure : public Command
class CommandNSSASetSecure : public CommandNSSetSecure
{
public:
- CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2, "nickserv/saset/secure")
+ CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
diff --git a/modules/core/ns_suspend.cpp b/modules/core/ns_suspend.cpp
index 33eb5ad67..50cf039ce 100644
--- a/modules/core/ns_suspend.cpp
+++ b/modules/core/ns_suspend.cpp
@@ -16,7 +16,7 @@
class CommandNSSuspend : public Command
{
public:
- CommandNSSuspend(Module *creator) : Command(creator, "nickserv/suspend", 2, 2, "nickserv/suspend")
+ CommandNSSuspend(Module *creator) : Command(creator, "nickserv/suspend", 2, 2)
{
this->SetDesc(_("Suspend a given nick"));
this->SetSyntax(_("\037nickname\037 \037reason\037"));
@@ -92,7 +92,7 @@ class CommandNSSuspend : public Command
class CommandNSUnSuspend : public Command
{
public:
- CommandNSUnSuspend(Module *creator) : Command(creator, "nickserv/unsuspend", 1, 1, "nickserv/suspend")
+ CommandNSUnSuspend(Module *creator) : Command(creator, "nickserv/unsuspend", 1, 1)
{
this->SetDesc(_("Unsuspend a given nick"));
this->SetSyntax(_("\037nickname\037"));
diff --git a/modules/core/os_akill.cpp b/modules/core/os_akill.cpp
index 9a268d333..05602a746 100644
--- a/modules/core/os_akill.cpp
+++ b/modules/core/os_akill.cpp
@@ -370,7 +370,7 @@ class CommandOSAKill : public Command
return;
}
public:
- CommandOSAKill(Module *creator) : Command(creator, "operserv/akill", 1, 4, "operserv/akill")
+ CommandOSAKill(Module *creator) : Command(creator, "operserv/akill", 1, 4)
{
this->SetDesc(_("Manipulate the AKILL list"));
this->SetSyntax(_("ADD [+\037expiry\037] \037mask\037 \037reason\037"));
diff --git a/modules/core/os_chankill.cpp b/modules/core/os_chankill.cpp
index 54530d7af..9ce895c59 100644
--- a/modules/core/os_chankill.cpp
+++ b/modules/core/os_chankill.cpp
@@ -18,7 +18,7 @@ static service_reference<XLineManager> akills("xlinemanager/sgline");
class CommandOSChanKill : public Command
{
public:
- CommandOSChanKill(Module *creator) : Command(creator, "operserv/chankill", 2, 3, "operserv/chankill")
+ CommandOSChanKill(Module *creator) : Command(creator, "operserv/chankill", 2, 3)
{
this->SetDesc(_("AKILL all users on a specific channel"));
this->SetSyntax(_("[+\037expiry\037] \037channel\037 \037reason\037"));
diff --git a/modules/core/os_config.cpp b/modules/core/os_config.cpp
index ea7842b5d..1d1fead33 100644
--- a/modules/core/os_config.cpp
+++ b/modules/core/os_config.cpp
@@ -32,7 +32,7 @@ class CommandOSConfig : public Command
}
public:
- CommandOSConfig(Module *creator) : Command(creator, "operserv/config", 1, 4, "operserv/config")
+ CommandOSConfig(Module *creator) : Command(creator, "operserv/config", 1, 4)
{
this->SetDesc(_("View and change configuration file settings"));
this->SetSyntax(_("{\037MODIFY\037|\037VIEW\037} [\037block name\037 \037item name\037 \037item value\037]"));
diff --git a/modules/core/os_forbid.cpp b/modules/core/os_forbid.cpp
index 8c788006f..d4b4c2b41 100644
--- a/modules/core/os_forbid.cpp
+++ b/modules/core/os_forbid.cpp
@@ -77,7 +77,7 @@ class CommandOSForbid : public Command
{
service_reference<ForbidService> fs;
public:
- CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5, "operserv/forbid"), fs("forbid")
+ CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("forbid")
{
this->SetDesc(_("Forbid usage of nicknames, channels, and emails"));
this->SetSyntax(_("ADD {NICK|CHAN|EMAIL} [+\037expiry\037] \037entry\037\002 [\037reason\037]"));
diff --git a/modules/core/os_ignore.cpp b/modules/core/os_ignore.cpp
index 0713f928f..9f50ec967 100644
--- a/modules/core/os_ignore.cpp
+++ b/modules/core/os_ignore.cpp
@@ -233,7 +233,7 @@ class CommandOSIgnore : public Command
}
public:
- CommandOSIgnore(Module *creator) : Command(creator, "operserv/ignore", 1, 4, "operserv/ignore")
+ CommandOSIgnore(Module *creator) : Command(creator, "operserv/ignore", 1, 4)
{
this->SetDesc(_("Modify the Services ignore list"));
this->SetSyntax(_("ADD \037time\037 \037nick\037 \037reason\037"));
diff --git a/modules/core/os_jupe.cpp b/modules/core/os_jupe.cpp
index a0e06c272..a689b33e2 100644
--- a/modules/core/os_jupe.cpp
+++ b/modules/core/os_jupe.cpp
@@ -16,7 +16,7 @@
class CommandOSJupe : public Command
{
public:
- CommandOSJupe(Module *creator) : Command(creator, "operserv/jupe", 1, 2, "operserv/jupe")
+ CommandOSJupe(Module *creator) : Command(creator, "operserv/jupe", 1, 2)
{
this->SetDesc(_("\"Jupiter\" a server"));
this->SetSyntax(_("\037server\037 [\037reason\037]"));
diff --git a/modules/core/os_kick.cpp b/modules/core/os_kick.cpp
index cd36c118e..341ea1ee6 100644
--- a/modules/core/os_kick.cpp
+++ b/modules/core/os_kick.cpp
@@ -16,7 +16,7 @@
class CommandOSKick : public Command
{
public:
- CommandOSKick(Module *creator) : Command(creator, "operserv/kick", 3, 3, "operserv/kick")
+ CommandOSKick(Module *creator) : Command(creator, "operserv/kick", 3, 3)
{
this->SetDesc(_("Kick a user from a channel"));
this->SetSyntax(_("\037channel\037 \037user\037 \037reason\037"));
diff --git a/modules/core/os_kill.cpp b/modules/core/os_kill.cpp
index a3f9b658f..11a0636ef 100644
--- a/modules/core/os_kill.cpp
+++ b/modules/core/os_kill.cpp
@@ -16,7 +16,7 @@
class CommandOSKill : public Command
{
public:
- CommandOSKill(Module *creator) : Command(creator, "operserv/kill", 1, 2, "operserv/kill")
+ CommandOSKill(Module *creator) : Command(creator, "operserv/kill", 1, 2)
{
this->SetDesc(_("Kill a user"));
this->SetSyntax(_("\037user\037 [\037reason\037]"));
diff --git a/modules/core/os_mode.cpp b/modules/core/os_mode.cpp
index 41f870d64..b3e62ca25 100644
--- a/modules/core/os_mode.cpp
+++ b/modules/core/os_mode.cpp
@@ -16,7 +16,7 @@
class CommandOSMode : public Command
{
public:
- CommandOSMode(Module *creator) : Command(creator, "operserv/mode", 2, 2, "operserv/mode")
+ CommandOSMode(Module *creator) : Command(creator, "operserv/mode", 2, 2)
{
this->SetDesc(_("Change channel modes"));
this->SetSyntax(_("\037channel\037 \037modes\037"));
@@ -54,7 +54,7 @@ class CommandOSMode : public Command
class CommandOSUMode : public Command
{
public:
- CommandOSUMode(Module *creator) : Command(creator, "operserv/umode", 2, 2, "operserv/umode")
+ CommandOSUMode(Module *creator) : Command(creator, "operserv/umode", 2, 2)
{
this->SetDesc(_("Change channel or user modes"));
this->SetSyntax(_("\037user\037 \037modes\037"));
diff --git a/modules/core/os_modinfo.cpp b/modules/core/os_modinfo.cpp
index d62a7ebce..38d9cf905 100644
--- a/modules/core/os_modinfo.cpp
+++ b/modules/core/os_modinfo.cpp
@@ -43,11 +43,13 @@ class CommandOSModInfo : public Command
{
BotInfo *bi = it->second;
- for (command_map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit)
+ for (BotInfo::command_map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit)
{
- if (cit->second != s->name)
+ const Anope::string &c_name = cit->first;
+ const CommandInfo &info = cit->second;
+ if (info.name != s->name)
continue;
- source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), cit->first.c_str(), bi->nick.c_str(), s->name.c_str());
+ source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), c_name.c_str(), bi->nick.c_str(), s->name.c_str());
}
}
}
@@ -70,7 +72,7 @@ class CommandOSModInfo : public Command
class CommandOSModList : public Command
{
public:
- CommandOSModList(Module *creator) : Command(creator, "operserv/modlist", 0, 1, "operserv/modlist")
+ CommandOSModList(Module *creator) : Command(creator, "operserv/modlist", 0, 1)
{
this->SetDesc(_("List loaded modules"));
this->SetSyntax(_("[Core|3rd|protocol|encryption|supported]"));
diff --git a/modules/core/os_module.cpp b/modules/core/os_module.cpp
index fb56d322e..562e130aa 100644
--- a/modules/core/os_module.cpp
+++ b/modules/core/os_module.cpp
@@ -16,7 +16,7 @@
class CommandOSModLoad : public Command
{
public:
- CommandOSModLoad(Module *creator) : Command(creator, "operserv/modload", 1, 1, "operserv/modload")
+ CommandOSModLoad(Module *creator) : Command(creator, "operserv/modload", 1, 1)
{
this->SetDesc(_("Load a module"));
this->SetSyntax(_("\037modname\037"));
@@ -61,7 +61,7 @@ class CommandOSModLoad : public Command
class CommandOSModReLoad : public Command
{
public:
- CommandOSModReLoad(Module *creator) : Command(creator, "operserv/modreload", 1, 1, "operserv/modload")
+ CommandOSModReLoad(Module *creator) : Command(creator, "operserv/modreload", 1, 1)
{
this->SetDesc(_("Reload a module"));
this->SetSyntax(_("\037modname\037"));
@@ -131,7 +131,7 @@ class CommandOSModReLoad : public Command
class CommandOSModUnLoad : public Command
{
public:
- CommandOSModUnLoad(Module *creator) : Command(creator, "operserv/modunload", 1, 1, "operserv/modload")
+ CommandOSModUnLoad(Module *creator) : Command(creator, "operserv/modunload", 1, 1)
{
this->SetDesc(_("Un-Load a module"));
this->SetSyntax(_("\037modname\037"));
diff --git a/modules/core/os_news.cpp b/modules/core/os_news.cpp
index 6eac9db1f..9c9aae0a4 100644
--- a/modules/core/os_news.cpp
+++ b/modules/core/os_news.cpp
@@ -216,7 +216,7 @@ class NewsBase : public Command
return;
}
public:
- NewsBase(Module *creator, const Anope::string &newstype) : Command(creator, newstype, 1, 2, "operserv/news"), ns("news")
+ NewsBase(Module *creator, const Anope::string &newstype) : Command(creator, newstype, 1, 2), ns("news")
{
this->SetSyntax(_("ADD \037text\037"));
this->SetSyntax(_("DEL {\037num\037 | ALL}"));
diff --git a/modules/core/os_noop.cpp b/modules/core/os_noop.cpp
index 9fdaf0ebb..2eec522a3 100644
--- a/modules/core/os_noop.cpp
+++ b/modules/core/os_noop.cpp
@@ -16,7 +16,7 @@
class CommandOSNOOP : public Command
{
public:
- CommandOSNOOP(Module *creator) : Command(creator, "operserv/noop", 2, 2, "operserv/noop")
+ CommandOSNOOP(Module *creator) : Command(creator, "operserv/noop", 2, 2)
{
this->SetDesc(_("Temporarily remove all O:lines of a server remotely"));
this->SetSyntax(_("SET \037server\037"));
diff --git a/modules/core/os_oline.cpp b/modules/core/os_oline.cpp
index f07996542..adebc52a1 100644
--- a/modules/core/os_oline.cpp
+++ b/modules/core/os_oline.cpp
@@ -16,7 +16,7 @@
class CommandOSOLine : public Command
{
public:
- CommandOSOLine(Module *creator) : Command(creator, "operserv/oline", 2, 2, "operserv/oline")
+ CommandOSOLine(Module *creator) : Command(creator, "operserv/oline", 2, 2)
{
this->SetDesc(_("Give Operflags to a certain user"));
this->SetSyntax(_("\037nick\037 \037flags\037"));
diff --git a/modules/core/os_oper.cpp b/modules/core/os_oper.cpp
index 8c4745c2a..237c0b5bc 100644
--- a/modules/core/os_oper.cpp
+++ b/modules/core/os_oper.cpp
@@ -16,7 +16,7 @@
class CommandOSOper : public Command
{
public:
- CommandOSOper(Module *creator) : Command(creator, "operserv/oper", 1, 3, "operserv/oper")
+ CommandOSOper(Module *creator) : Command(creator, "operserv/oper", 1, 3)
{
this->SetDesc(_("View and change services operators"));
this->SetSyntax(_("ADD \037oper\037 \037type\037"));
diff --git a/modules/core/os_reload.cpp b/modules/core/os_reload.cpp
index 4d34a8ab1..d4d8eac7c 100644
--- a/modules/core/os_reload.cpp
+++ b/modules/core/os_reload.cpp
@@ -16,7 +16,7 @@
class CommandOSReload : public Command
{
public:
- CommandOSReload(Module *creator) : Command(creator, "operserv/reload", 0, 0, "operserv/reload")
+ CommandOSReload(Module *creator) : Command(creator, "operserv/reload", 0, 0)
{
this->SetDesc(_("Reload services' configuration file"));
this->SetSyntax("");
diff --git a/modules/core/os_session.cpp b/modules/core/os_session.cpp
index d39896608..990cd1b4b 100644
--- a/modules/core/os_session.cpp
+++ b/modules/core/os_session.cpp
@@ -266,7 +266,7 @@ class CommandOSSession : public Command
return;
}
public:
- CommandOSSession(Module *creator) : Command(creator, "operserv/session", 2, 2, "operserv/session")
+ CommandOSSession(Module *creator) : Command(creator, "operserv/session", 2, 2)
{
this->SetDesc(_("View the list of host sessions"));
this->SetSyntax(_("LIST \037threshold\037"));
diff --git a/modules/core/os_set.cpp b/modules/core/os_set.cpp
index 36c46e439..2a50f851c 100644
--- a/modules/core/os_set.cpp
+++ b/modules/core/os_set.cpp
@@ -168,7 +168,7 @@ class CommandOSSet : public Command
return;
}
public:
- CommandOSSet(Module *creator) : Command(creator, "operserv/set", 1, 2, "operserv/set")
+ CommandOSSet(Module *creator) : Command(creator, "operserv/set", 1, 2)
{
this->SetDesc(_("Set various global Services options"));
this->SetSyntax(_("\037option\037 \037setting\037"));
diff --git a/modules/core/os_shutdown.cpp b/modules/core/os_shutdown.cpp
index 47cb2e4cf..bc3a19353 100644
--- a/modules/core/os_shutdown.cpp
+++ b/modules/core/os_shutdown.cpp
@@ -16,7 +16,7 @@
class CommandOSQuit : public Command
{
public:
- CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 0, "operserv/quit")
+ CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 0)
{
this->SetDesc(_("Terminate Services WITHOUT saving"));
this->SetSyntax("");
@@ -45,7 +45,7 @@ class CommandOSQuit : public Command
class CommandOSRestart : public Command
{
public:
- CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 0, "operserv/restart")
+ CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 0)
{
this->SetDesc(_("Save databases and restart Services"));
this->SetSyntax("");
@@ -72,7 +72,7 @@ class CommandOSRestart : public Command
class CommandOSShutdown : public Command
{
public:
- CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 0, "operserv/shutdown")
+ CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 0)
{
this->SetDesc(_("Terminate services with save"));
this->SetSyntax("");
diff --git a/modules/core/os_stats.cpp b/modules/core/os_stats.cpp
index 2627a4538..2c20395d0 100644
--- a/modules/core/os_stats.cpp
+++ b/modules/core/os_stats.cpp
@@ -157,7 +157,7 @@ class CommandOSStats : public Command
}
public:
- CommandOSStats(Module *creator) : Command(creator, "operserv/stats", 0, 1, "operserv/stats"),
+ CommandOSStats(Module *creator) : Command(creator, "operserv/stats", 0, 1),
akills("xlinemanager/sgline"), snlines("xlinemanager/snline"), sqlines("xlinemanager/sqline"), szlines("xlinemanager/szline")
{
this->SetDesc(_("Show status of Services and network"));
diff --git a/modules/core/os_svsnick.cpp b/modules/core/os_svsnick.cpp
index 0e2199399..dc7c77a6c 100644
--- a/modules/core/os_svsnick.cpp
+++ b/modules/core/os_svsnick.cpp
@@ -16,7 +16,7 @@
class CommandOSSVSNick : public Command
{
public:
- CommandOSSVSNick(Module *creator) : Command(creator, "operserv/svsnick", 2, 2, "operserv/svsnick")
+ CommandOSSVSNick(Module *creator) : Command(creator, "operserv/svsnick", 2, 2)
{
this->SetDesc(_("Forcefully change a user's nickname"));
this->SetSyntax(_("\037nick\037 \037newnick\037"));
diff --git a/modules/core/os_sxline.cpp b/modules/core/os_sxline.cpp
index 27df5d5d1..f949cb7d2 100644
--- a/modules/core/os_sxline.cpp
+++ b/modules/core/os_sxline.cpp
@@ -278,7 +278,7 @@ class CommandOSSXLineBase : public Command
return;
}
public:
- CommandOSSXLineBase(Module *creator, const Anope::string &cmd, const Anope::string &perm) : Command(creator, cmd, 1, 3, perm)
+ CommandOSSXLineBase(Module *creator, const Anope::string &cmd) : Command(creator, cmd, 1, 3)
{
this->SetDesc(Anope::printf(_("Manipulate the %s list"), cmd.c_str()));
this->SetSyntax(_("ADD [+\037expiry\037] \037mask\037:\037reason\037"));
@@ -430,7 +430,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
service_reference<XLineManager> snlines;
public:
- CommandOSSNLine(Module *creator) : CommandOSSXLineBase(creator, "SNLINE", "operserv/snline"), snlines("xlinemanager/snline")
+ CommandOSSNLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/snline"), snlines("xlinemanager/snline")
{
}
@@ -580,7 +580,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
service_reference<XLineManager> sqlines;
public:
- CommandOSSQLine(Module *creator) : CommandOSSXLineBase(creator, "SQLINE", "operserv/sqline"), sqlines("xlinemanager/sqline")
+ CommandOSSQLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/sqline"), sqlines("xlinemanager/sqline")
{
}
@@ -736,7 +736,7 @@ class CommandOSSZLine : public CommandOSSXLineBase
service_reference<XLineManager> szlines;
public:
- CommandOSSZLine(Module *creator) : CommandOSSXLineBase(creator, "SZLINE", "operserv/szline"), szlines("xlinemanager/szline")
+ CommandOSSZLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/szline"), szlines("xlinemanager/szline")
{
}
diff --git a/modules/core/os_update.cpp b/modules/core/os_update.cpp
index a128f711f..776835cf7 100644
--- a/modules/core/os_update.cpp
+++ b/modules/core/os_update.cpp
@@ -16,7 +16,7 @@
class CommandOSUpdate : public Command
{
public:
- CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0, "operserv/update")
+ CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0)
{
this->SetDesc(_("Force the Services databases to be updated immediately"));
this->SetSyntax("");
diff --git a/modules/extra/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp
index fc9ae9cf6..8f145ab88 100644
--- a/modules/extra/cs_set_misc.cpp
+++ b/modules/extra/cs_set_misc.cpp
@@ -15,7 +15,7 @@
class CommandCSSetMisc : public Command
{
public:
- CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
+ CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc") : Command(creator, cname, 1, 2)
{
this->SetSyntax(_("\037channel\037 \037parameters\037"));
}
@@ -43,7 +43,7 @@ class CommandCSSetMisc : public Command
class CommandCSSASetMisc : public CommandCSSetMisc
{
public:
- CommandCSSASetMisc(Module *creator) : CommandCSSetMisc(creator, "chanserv/saset/misc", "chanserv/saset/misc")
+ CommandCSSASetMisc(Module *creator) : CommandCSSetMisc(creator, "chanserv/saset/misc")
{
}
};
diff --git a/modules/extra/hs_request.cpp b/modules/extra/hs_request.cpp
index f846b6167..7686794f5 100644
--- a/modules/extra/hs_request.cpp
+++ b/modules/extra/hs_request.cpp
@@ -134,7 +134,7 @@ class CommandHSRequest : public Command
class CommandHSActivate : public Command
{
public:
- CommandHSActivate(Module *creator) : Command(creator, "hostserv/activate", 1, 1, "hostserv/set")
+ CommandHSActivate(Module *creator) : Command(creator, "hostserv/activate", 1, 1)
{
this->SetDesc(_("Approve the requested vHost of a user"));
this->SetSyntax(_("\037nick\037"));
@@ -187,7 +187,7 @@ class CommandHSActivate : public Command
class CommandHSReject : public Command
{
public:
- CommandHSReject(Module *creator) : Command(creator, "hostserv/reject", 1, 2, "hostserv/set")
+ CommandHSReject(Module *creator) : Command(creator, "hostserv/reject", 1, 2)
{
this->SetDesc(_("Reject the requested vHost of a user"));
}
@@ -264,7 +264,7 @@ class HSListBase : public Command
return;
}
public:
- HSListBase(Module *creator, const Anope::string &cmd, int min, int max) : Command(creator, cmd, min, max, "hostserv/set")
+ HSListBase(Module *creator, const Anope::string &cmd, int min, int max) : Command(creator, cmd, min, max)
{
}
};
diff --git a/modules/extra/m_async_commands.cpp b/modules/extra/m_async_commands.cpp
index 84d7a4f41..814c86c92 100644
--- a/modules/extra/m_async_commands.cpp
+++ b/modules/extra/m_async_commands.cpp
@@ -46,7 +46,7 @@ class AsynchCommandMutex : public CommandMutex
return;
}
- if (!command->permission.empty() && !u->HasCommand(command->permission))
+ if (!this->source.permission.empty() && !u->HasCommand(this->source.permission))
{
u->SendMessage(bi, ACCESS_DENIED);
Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command;
diff --git a/modules/extra/ns_set_misc.cpp b/modules/extra/ns_set_misc.cpp
index 47506ce89..f0ee269cc 100644
--- a/modules/extra/ns_set_misc.cpp
+++ b/modules/extra/ns_set_misc.cpp
@@ -16,7 +16,7 @@
class CommandNSSetMisc : public Command
{
public:
- CommandNSSetMisc(Module *creator, const Anope::string &cname = "nickserv/set/misc", const Anope::string &cpermission = "", size_t min = 1) : Command(creator, cname, min, min + 1, cpermission)
+ CommandNSSetMisc(Module *creator, const Anope::string &cname = "nickserv/set/misc", size_t min = 1) : Command(creator, cname, min, min + 1)
{
this->SetSyntax(_("\037parameter\037"));
}
@@ -52,7 +52,7 @@ class CommandNSSetMisc : public Command
class CommandNSSASetMisc : public CommandNSSetMisc
{
public:
- CommandNSSASetMisc(Module *creator) : CommandNSSetMisc(creator, "nickserv/saset/misc", "nickserv/saset/misc", 2)
+ CommandNSSASetMisc(Module *creator) : CommandNSSetMisc(creator, "nickserv/saset/misc", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037parameter\037"));
diff --git a/modules/extra/os_defcon.cpp b/modules/extra/os_defcon.cpp
index 26120feff..ea513e1dc 100644
--- a/modules/extra/os_defcon.cpp
+++ b/modules/extra/os_defcon.cpp
@@ -163,7 +163,7 @@ class CommandOSDefcon : public Command
}
public:
- CommandOSDefcon(Module *creator) : Command(creator, "operserv/defcon", 1, 1, "operserv/defcon")
+ CommandOSDefcon(Module *creator) : Command(creator, "operserv/defcon", 1, 1)
{
this->SetDesc(_("Manipulate the DefCon system"));
this->SetSyntax(_("[\0021\002|\0022\002|\0023\002|\0024\002|\0025\002]"));