diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/commands/cs_akick.cpp | 6 | ||||
-rw-r--r-- | modules/commands/cs_mode.cpp | 13 | ||||
-rw-r--r-- | modules/m_xmlrpc_main.cpp | 18 | ||||
-rw-r--r-- | modules/pseudoclients/botserv.cpp | 6 | ||||
-rw-r--r-- | modules/webcpanel/pages/chanserv/modes.cpp | 6 |
5 files changed, 22 insertions, 27 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 873b1cb43..1fac25335 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -71,10 +71,10 @@ class CommandCSAKick : public Command /* Check excepts BEFORE we get this far */ if (ci->c) { - std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList("EXCEPT"); - for (; modes.first != modes.second; ++modes.first) + std::vector<Anope::string> modes = ci->c->GetModeList("EXCEPT"); + for (unsigned int i = 0; i < modes.size(); ++i) { - if (Anope::Match(modes.first->second, mask)) + if (Anope::Match(modes[i], mask)) { source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str()); return; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 7f22d1e26..d5c356fa4 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -615,15 +615,10 @@ class CommandCSMode : public Command } else { - std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> its = ci->c->GetModeList(cm->name); - for (; its.first != its.second;) - { - const Anope::string &mask = its.first->second; - ++its.first; - - if (Anope::Match(mask, param)) - ci->c->RemoveMode(NULL, cm, mask); - } + std::vector<Anope::string> v = ci->c->GetModeList(cm->name); + for (unsigned j = 0; j < v.size(); ++j) + if (Anope::Match(v[j], param)) + ci->c->RemoveMode(NULL, cm, v[j]); } } } diff --git a/modules/m_xmlrpc_main.cpp b/modules/m_xmlrpc_main.cpp index 1a496c65c..13645bc98 100644 --- a/modules/m_xmlrpc_main.cpp +++ b/modules/m_xmlrpc_main.cpp @@ -155,21 +155,21 @@ class MyXMLRPCEvent : public XMLRPCEvent { request.reply("bancount", stringify(c->HasMode("BAN"))); int count = 0; - std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> its = c->GetModeList("BAN"); - for (; its.first != its.second; ++its.first) - request.reply("ban" + stringify(++count), iface->Sanitize(its.first->second)); + std::vector<Anope::string> v = c->GetModeList("BAN"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("ban" + stringify(++count), iface->Sanitize(v[i])); request.reply("exceptcount", stringify(c->HasMode("EXCEPT"))); count = 0; - its = c->GetModeList("EXCEPT"); - for (; its.first != its.second; ++its.first) - request.reply("except" + stringify(++count), iface->Sanitize(its.first->second)); + v = c->GetModeList("EXCEPT"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("except" + stringify(++count), iface->Sanitize(v[i])); request.reply("invitecount", stringify(c->HasMode("INVITEOVERRIDE"))); count = 0; - its = c->GetModeList("INVITEOVERRIDE"); - for (; its.first != its.second; ++its.first) - request.reply("invite" + stringify(++count), iface->Sanitize(its.first->second)); + v = c->GetModeList("INVITEOVERRIDE"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("invite" + stringify(++count), iface->Sanitize(v[i])); Anope::string users; for (Channel::ChanUserList::const_iterator it = c->users.begin(); it != c->users.end(); ++it) diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 48d604a6c..55c57b974 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -56,12 +56,12 @@ class BotServCore : public Module BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL; if (bi && Config->GetModule(this)->Get<bool>("smartjoin")) { - std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = c->GetModeList("BAN"); + std::vector<Anope::string> bans = c->GetModeList("BAN"); /* We check for bans */ - for (; bans.first != bans.second; ++bans.first) + for (unsigned int i = 0; i < bans.size(); ++i) { - Entry ban("BAN", bans.first->second); + Entry ban("BAN", bans[i]); if (ban.Matches(user)) c->RemoveMode(NULL, "BAN", ban.GetMask()); } diff --git a/modules/webcpanel/pages/chanserv/modes.cpp b/modules/webcpanel/pages/chanserv/modes.cpp index d5b111708..e01239f58 100644 --- a/modules/webcpanel/pages/chanserv/modes.cpp +++ b/modules/webcpanel/pages/chanserv/modes.cpp @@ -94,9 +94,9 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements); } - std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> ml = c->GetModeList(cm->name); - for (; ml.first != ml.second; ++ml.first) - replacements["MASKS"] = HTTPUtils::Escape(ml.first->second); + std::vector<Anope::string> v = c->GetModeList(cm->name); + for (unsigned int i = 0; i < v.size(); ++i) + replacements["MASKS"] = HTTPUtils::Escape(v[i]); } Page.Serve(server, page_name, client, message, reply, replacements); |