diff options
author | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
commit | ee5cd8493e34a1c049066ead25e9094b30cd49b5 (patch) | |
tree | 846c6dcd9bb2c4d721c6290a9b9d6b6ed880acdb /modules/commands/cs_xop.cpp | |
parent | 41e8d276023e8fefc22fb89c2f81ae17b8222155 (diff) |
Use C++11's explicit override feature if available
Diffstat (limited to 'modules/commands/cs_xop.cpp')
-rw-r--r-- | modules/commands/cs_xop.cpp | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 39789bf89..5ca488535 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -99,7 +99,7 @@ class XOPChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &priv) const + bool HasPriv(const Anope::string &priv) const anope_override { for (int i = 0; xopAccess[i].type != XOP_UNKNOWN; ++i) { @@ -129,7 +129,7 @@ class XOPChanAccess : public ChanAccess return ""; } - void Unserialize(const Anope::string &data) + void Unserialize(const Anope::string &data) anope_override { for (int i = 0; xopAccess[i].type != XOP_UNKNOWN; ++i) { @@ -188,7 +188,7 @@ class XOPAccessProvider : public AccessProvider { } - ChanAccess *Create() + ChanAccess *Create() anope_override { return new XOPChanAccess(this); } @@ -340,7 +340,7 @@ class XOPBase : public Command } } - void HandleNumber(unsigned Number) + void HandleNumber(unsigned Number) anope_override { if (!Number || Number > ci->GetAccessCount()) return; @@ -394,17 +394,11 @@ class XOPBase : public Command const Anope::string &nick = params.size() > 2 ? params[2] : ""; AccessGroup access = ci->AccessFor(u); - bool override = false; - if (!access.HasPriv("ACCESS_LIST")) + if (!access.HasPriv("ACCESS_LIST") && !u->HasCommand("chanserv/access/list")) { - if (u->HasCommand("chanserv/access/list")) - override = true; - else - { - source.Reply(ACCESS_DENIED); - return; - } + source.Reply(ACCESS_DENIED); + return; } if (!ci->GetAccessCount()) @@ -428,7 +422,7 @@ class XOPBase : public Command { } - void HandleNumber(unsigned Number) + void HandleNumber(unsigned Number) anope_override { if (!Number || Number > ci->GetAccessCount()) return; @@ -567,12 +561,12 @@ class CommandCSQOP : public XOPBase this->SetDesc(_("Modify the list of QOP users")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { return this->DoXop(source, params, XOP_QOP); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { this->SendSyntax(source); source.Reply(" "); @@ -621,12 +615,12 @@ class CommandCSAOP : public XOPBase this->SetDesc(_("Modify the list of AOP users")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { return this->DoXop(source, params, XOP_AOP); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { this->SendSyntax(source); source.Reply(" "); @@ -677,12 +671,12 @@ class CommandCSHOP : public XOPBase this->SetDesc(_("Maintains the HOP (HalfOP) list for a channel")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { return this->DoXop(source, params, XOP_HOP); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { this->SendSyntax(source); source.Reply(" "); @@ -731,12 +725,12 @@ class CommandCSSOP : public XOPBase this->SetDesc(_("Modify the list of SOP users")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { return this->DoXop(source, params, XOP_SOP); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { this->SendSyntax(source); source.Reply(" "); @@ -786,12 +780,12 @@ class CommandCSVOP : public XOPBase this->SetDesc(_("Maintains the VOP (VOicePeople) list for a channel")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { return this->DoXop(source, params, XOP_VOP); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { this->SendSyntax(source); source.Reply(" "); |