diff options
Diffstat (limited to 'modules/commands/ns_group.cpp')
-rw-r--r-- | modules/commands/ns_group.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 6830b7cd1..af9b71584 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -22,7 +22,7 @@ class NSGroupRequest : public IdentifyRequest public: NSGroupRequest(Module *o, CommandSource &src, Command *c, const Anope::string &n, NickAlias *targ, const Anope::string &pass) : IdentifyRequest(o, targ->nc->display, pass), source(src), cmd(c), nick(n), target(targ) { } - void OnSuccess() anope_override + void OnSuccess() override { User *u = source.GetUser(); @@ -67,7 +67,7 @@ class NSGroupRequest : public IdentifyRequest u->lastnickreg = Anope::CurTime; } - void OnFail() anope_override + void OnFail() override { User *u = source.GetUser(); @@ -93,7 +93,7 @@ class CommandNSGroup : public Command this->AllowUnregistered(true); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { User *user = source.GetUser(); @@ -128,16 +128,16 @@ class CommandNSGroup : public Command } if (Config->GetModule("nickserv")->Get<bool>("restrictopernicks")) - for (unsigned i = 0; i < Oper::opers.size(); ++i) + { + for (auto *o : Oper::opers) { - Oper *o = Oper::opers[i]; - if (user != NULL && !user->HasMode("OPER") && user->nick.find_ci(o->name) != Anope::string::npos) { source.Reply(NICK_CANNOT_BE_REGISTERED, user->nick.c_str()); return; } } + } NickAlias *target, *na = NickAlias::Find(source.GetNick()); const Anope::string &guestnick = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest"); @@ -194,7 +194,7 @@ class CommandNSGroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -237,7 +237,7 @@ class CommandNSUngroup : public Command this->SetSyntax(_("[\037nick\037]")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { Anope::string nick = !params.empty() ? params[0] : ""; NickAlias *na = NickAlias::Find(!nick.empty() ? nick : source.GetNick()); @@ -278,7 +278,7 @@ class CommandNSUngroup : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -299,7 +299,7 @@ class CommandNSGList : public Command this->SetDesc(_("Lists all nicknames in your group")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { const Anope::string &nick = !params.empty() ? params[0] : ""; const NickCore *nc; @@ -325,12 +325,10 @@ class CommandNSGList : public Command ListFormatter list(source.GetAccount()); list.AddColumn(_("Nick")).AddColumn(_("Expires")); - time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire", "21d"), + time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire", "90d"), unconfirmed_expire = Config->GetModule("ns_register")->Get<time_t>("unconfirmedexpire", "1d"); - for (unsigned i = 0; i < nc->aliases->size(); ++i) + for (auto *na2 : *nc->aliases) { - const NickAlias *na2 = nc->aliases->at(i); - Anope::string expires; if (na2->HasExt("NS_NO_EXPIRE")) expires = NO_EXPIRE; @@ -351,13 +349,13 @@ class CommandNSGList : public Command std::vector<Anope::string> replies; list.Process(replies); - for (unsigned i = 0; i < replies.size(); ++i) - source.Reply(replies[i]); + for (const auto &reply : replies) + source.Reply(reply); source.Reply(_("%d nickname(s) in the group."), nc->aliases->size()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { if (source.IsServicesOper()) source.Reply(_("Syntax: \002%s [\037nickname\037]\002\n" |