summaryrefslogtreecommitdiff
path: root/modules/commands/cs_akick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_akick.cpp')
-rw-r--r--modules/commands/cs_akick.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp
index 4ccf2a3b4..78215dacd 100644
--- a/modules/commands/cs_akick.cpp
+++ b/modules/commands/cs_akick.cpp
@@ -96,10 +96,9 @@ class CommandCSAKick : public Command
/* Check excepts BEFORE we get this far */
if (ci->c)
{
- std::vector<Anope::string> modes = ci->c->GetModeList("EXCEPT");
- for (unsigned int i = 0; i < modes.size(); ++i)
+ for (const auto &mode : ci->c->GetModeList("EXCEPT"))
{
- if (Anope::Match(modes[i], mask))
+ if (Anope::Match(mode, mask))
{
source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str());
return;
@@ -129,10 +128,8 @@ class CommandCSAKick : public Command
{
/* Match against all currently online users with equal or
* higher access. - Viper */
- for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
+ for (const auto &[_, u2] : UserListByNick)
{
- User *u2 = it->second;
-
AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci);
Entry entry_mask("", mask);
@@ -145,9 +142,9 @@ class CommandCSAKick : public Command
/* Match against the lastusermask of all nickalias's with equal
* or higher access. - Viper */
- for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it)
+ for (const auto &[_, na2] : *NickAliasList)
{
- na = it->second;
+ na = na2;
AccessGroup nc_access = ci->AccessFor(na->nc), u_access = source.AccessFor(ci);
if (na->nc && (na->nc == ci->GetFounder() || nc_access >= u_access))
@@ -211,14 +208,14 @@ class CommandCSAKick : public Command
CommandSource &source;
ChannelInfo *ci;
Command *c;
- unsigned deleted;
+ unsigned deleted = 0;
AccessGroup ag;
public:
- AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), ag(source.AccessFor(ci))
+ AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), ag(source.AccessFor(ci))
{
}
- ~AkickDelCallback()
+ ~AkickDelCallback() override
{
if (!deleted)
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
@@ -228,7 +225,7 @@ class CommandCSAKick : public Command
source.Reply(_("Deleted %d entries from %s autokick list."), deleted, ci->name.c_str());
}
- void HandleNumber(unsigned number) anope_override
+ void HandleNumber(unsigned number) override
{
if (!number || number > ci->GetAkickCount())
return;
@@ -293,7 +290,7 @@ class CommandCSAKick : public Command
{
}
- void HandleNumber(unsigned number) anope_override
+ void HandleNumber(unsigned number) override
{
if (!number || number > ci->GetAkickCount())
return;
@@ -373,8 +370,8 @@ class CommandCSAKick : public Command
source.Reply(_("Autokick list for %s:"), ci->name.c_str());
- for (unsigned i = 0; i < replies.size(); ++i)
- source.Reply(replies[i]);
+ for (const auto &reply : replies)
+ source.Reply(reply);
source.Reply(_("End of autokick list"));
}
@@ -440,7 +437,7 @@ class CommandCSAKick : public Command
this->SetSyntax(_("\037channel\037 CLEAR"));
}
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
Anope::string chan = params[0];
Anope::string cmd = params[1];
@@ -485,7 +482,7 @@ class CommandCSAKick : public Command
return;
}
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
+ bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
BotInfo *bi = Config->GetClient("NickServ");
this->SendSyntax(source);
@@ -538,7 +535,7 @@ class CSAKick : public Module
{
}
- EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override
+ EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override
{
if (!c->ci || c->MatchesList(u, "EXCEPT"))
return EVENT_CONTINUE;