diff options
Diffstat (limited to 'modules/commands/ns_list.cpp')
-rw-r--r-- | modules/commands/ns_list.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index af29d8658..3c690984e 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -20,7 +20,7 @@ class CommandNSList : public Command this->SetSyntax(_("\037pattern\037 [SUSPENDED] [NOEXPIRE] [UNCONFIRMED]")); } - 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 pattern = params[0]; @@ -75,13 +75,11 @@ class CommandNSList : public Command list.AddColumn(_("Nick")).AddColumn(_("Last usermask")); Anope::map<NickAlias *> ordered_map; - for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) - ordered_map[it->first] = it->second; + for (const auto &[nick, na] : *NickAliasList) + ordered_map[nick] = na; - for (Anope::map<NickAlias *>::const_iterator it = ordered_map.begin(), it_end = ordered_map.end(); it != it_end; ++it) + for (const auto &[_, na] : ordered_map) { - const NickAlias *na = it->second; - /* Don't show private nicks to non-services admins. */ if (na->nc->HasExt("NS_PRIVATE") && !is_servadmin && na->nc != mync) continue; @@ -125,14 +123,14 @@ class CommandNSList : 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(_("End of list - %d/%d matches shown."), nnicks > listmax ? listmax : nnicks, nnicks); return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -224,12 +222,12 @@ class CommandNSSetPrivate : public Command this->OnSyntaxError(source, "PRIVATE"); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, source.nc->display, params[0]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -252,12 +250,12 @@ class CommandNSSASetPrivate : public CommandNSSetPrivate this->SetSyntax(_("\037nickname\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { this->Run(source, params[0], params[1]); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(" "); @@ -288,7 +286,7 @@ class NSList : public Module { } - void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) anope_override + void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_all) override { if (!show_all) return; |