diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-02 14:09:45 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-02 14:09:45 +0000 |
commit | 29fd51d6f76a639fbd909e7bf7489eb92e9f90db (patch) | |
tree | fbb54bebe1b2edf415cd1c249fb5832ce42bdd68 /src/modules/m_override.cpp | |
parent | 423aa7ba0e7abc2fd6ba3f4a07bf79ec97c9389c (diff) |
Add chanrec::IsBanned() so that we dont have to keep walking the banlist in various modules and using match()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5099 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_override.cpp')
-rw-r--r-- | src/modules/m_override.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 342e42829..7dd58d8c2 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -231,17 +231,12 @@ class ModuleOverride : public Module if (CanOverride(user,"BANWALK")) { - for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++) + if (chan->IsBanned(user)) { - char mask[MAXBUF]; - sprintf(mask,"%s!%s@%s",user->nick, user->ident, user->GetIPString()); - if ((match(user->GetFullHost(),i->data)) || (match(user->GetFullRealHost(),i->data)) || (match(mask, i->data, true))) + if (NoisyOverride) { - if (NoisyOverride) - { - chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper-override to bypass channel bans on %s", cname, user->nick,i->data); - ServerInstance->SNO->WriteToSnoMask('O',"%s used oper-override to bypass channel bans on %s", cname, user->nick, i->data); - } + chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper-override to bypass channel ban", cname, user->nick); + ServerInstance->SNO->WriteToSnoMask('O',"%s used oper-override to bypass channel ban", cname, user->nick); } } return -1; |