summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/botserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-08-24 16:39:04 -0400
committerAdam <Adam@anope.org>2014-08-24 16:39:04 -0400
commitbf8f62c32d6c66e38c167e6ca0ac59d29db52326 (patch)
treeffdd06b244fcd38eca5956c7f9143f76ddcaaf5e /modules/pseudoclients/botserv.cpp
parentd417241a5b87e1e717755aa851ba0977857db873 (diff)
Change Channel::GetModeList to return a copy of the mode list, not a
pair of lower/upper bound iterators. Sometimes when iterating the list, like in cs_mode, we can modify the contents of it, which combined with mlock always agressively trying to readd modes to it can do bad things.
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
-rw-r--r--modules/pseudoclients/botserv.cpp6
1 files changed, 3 insertions, 3 deletions
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());
}