summaryrefslogtreecommitdiff
path: root/src/actions.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-20 21:45:30 -0500
committerAdam <Adam@anope.org>2010-12-12 19:35:27 -0500
commit246f44b9888161aecefc81f0ff17ddd893287e3c (patch)
treeb89607a9ad9c91914f292fc54cc32213a8d9f5c4 /src/actions.cpp
parenta85112172d842aa74aa5531788d383328d153e74 (diff)
Added cs_mode, rewrote the old list mode code, and added CIDR support
Diffstat (limited to 'src/actions.cpp')
-rw-r--r--src/actions.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/actions.cpp b/src/actions.cpp
index 4bb3563e5..6b3a96a24 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -71,28 +71,29 @@ void kill_user(const Anope::string &source, const Anope::string &user, const Ano
*/
void common_unban(ChannelInfo *ci, const Anope::string &nick)
{
- //uint32 ip = 0;
- User *u;
- Entry *ban, *next;
-
if (!ci || !ci->c || nick.empty())
return;
- if (!(u = finduser(nick)))
+ User *u = finduser(nick);
+ if (!u)
return;
- if (!ci->c->bans || !ci->c->bans->count)
+ if (!ci->c->HasMode(CMODE_BAN))
return;
if (ircd->svsmode_unban)
ircdproto->SendBanDel(ci->c, nick);
else
- for (ban = ci->c->bans->entries; ban; ban = next)
+ {
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = ci->c->GetModeList(CMODE_BAN);
+ for (; bans.first != bans.second;)
{
- next = ban->next;
- if (entry_match(ban, u->nick, u->GetIdent(), u->host, /*ip XXX */ 0) || entry_match(ban, u->nick, u->GetIdent(), u->GetDisplayedHost(), /*ip XXX */0))
- ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask);
+ Entry ban(bans.first->second);
+ ++bans.first;
+ if (ban.Matches(u))
+ ci->c->RemoveMode(NULL, CMODE_BAN, ban.GetMask());
}
+ }
}
/*************************************************************************/