diff options
Diffstat (limited to 'modules/commands/cs_unban.cpp')
-rw-r--r-- | modules/commands/cs_unban.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index 177a1a101..fec777cc0 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -20,7 +20,7 @@ class CommandCSUnban : public Command this->SetSyntax(_("\037channel\037 [\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 { ChannelMode *cm = ModeManager::FindChannelModeByName("BAN"); if (!cm) @@ -38,17 +38,15 @@ class CommandCSUnban : public Command source.GetAccount()->GetChannelReferences(queue); unsigned count = 0; - for (unsigned i = 0; i < queue.size(); ++i) + for (auto *ci : queue) { - ChannelInfo *ci = queue[i]; - if (!ci->c || !source.AccessFor(ci).HasPriv("UNBAN")) continue; - + FOREACH_MOD(OnChannelUnban, (source.GetUser(), ci)); - for (unsigned j = 0; j < modes.size(); ++j) - if (ci->c->Unban(source.GetUser(), modes[j]->name, true)) + for (const auto *mode : modes) + if (ci->c->Unban(source.GetUser(), mode->name, true)) ++count; } @@ -92,15 +90,15 @@ class CommandCSUnban : public Command FOREACH_MOD(OnChannelUnban, (u2, ci)); - for (unsigned i = 0; i < modes.size(); ++i) - ci->c->Unban(u2, modes[i]->name, source.GetUser() == u2); + for (const auto *mode : modes) + ci->c->Unban(u2, mode->name, source.GetUser() == u2); if (u2 == source.GetUser()) source.Reply(_("You have been unbanned from \002%s\002."), ci->c->name.c_str()); else source.Reply(_("\002%s\002 has been unbanned from \002%s\002."), u2->nick.c_str(), ci->c->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); |