diff options
author | Adam <Adam@anope.org> | 2010-11-20 21:45:30 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:35:27 -0500 |
commit | 246f44b9888161aecefc81f0ff17ddd893287e3c (patch) | |
tree | b89607a9ad9c91914f292fc54cc32213a8d9f5c4 /src/bots.cpp | |
parent | a85112172d842aa74aa5531788d383328d153e74 (diff) |
Added cs_mode, rewrote the old list mode code, and added CIDR support
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 9b2cfddb6..3d57afe6e 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -141,28 +141,24 @@ void BotInfo::Join(Channel *c, bool update_ts) { if (Config->BSSmartJoin) { + std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = c->GetModeList(CMODE_BAN); + /* We check for bans */ - if (c->bans && c->bans->count) + for (; bans.first != bans.second; ++bans.first) { - Entry *ban, *next; - - for (ban = c->bans->entries; ban; ban = next) - { - next = ban->next; - - if (entry_match(ban, this->nick, this->GetIdent(), this->host, 0)) - c->RemoveMode(NULL, CMODE_BAN, ban->mask); - } + Entry ban(bans.first->second); + if (ban.Matches(this)) + c->RemoveMode(NULL, CMODE_BAN, ban.GetMask()); + } - Anope::string Limit; - unsigned limit = 0; - if (c->GetParam(CMODE_LIMIT, Limit) && Limit.is_pos_number_only()) - limit = convertTo<unsigned>(Limit); + Anope::string Limit; + unsigned limit = 0; + if (c->GetParam(CMODE_LIMIT, Limit) && Limit.is_pos_number_only()) + limit = convertTo<unsigned>(Limit); - /* Should we be invited? */ - if (c->HasMode(CMODE_INVITE) || (limit && c->users.size() >= limit)) - ircdproto->SendNoticeChanops(this, c, "%s invited %s into the channel.", this->nick.c_str(), this->nick.c_str()); - } + /* Should we be invited? */ + if (c->HasMode(CMODE_INVITE) || (limit && c->users.size() >= limit)) + ircdproto->SendNoticeChanops(this, c, "%s invited %s into the channel.", this->nick.c_str(), this->nick.c_str()); ModeManager::ProcessModes(); } |