1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 06:53:12 +02:00

Added cs_mode, rewrote the old list mode code, and added CIDR support

This commit is contained in:
Adam
2010-11-20 21:45:30 -05:00
parent a85112172d
commit 246f44b988
42 changed files with 1251 additions and 1291 deletions
+11 -10
View File
@@ -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());
}
}
}
/*************************************************************************/