diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-21 20:56:16 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-21 20:56:16 +0000 |
commit | c16cda5d715241bb4bff8050bee942a8a34a72c0 (patch) | |
tree | 145095fad6904382ecf6775dedc5c981d406a61a /src/channels.cpp | |
parent | 5e3bfa266bd99ac15fd621c6e14d12787ba22f6e (diff) |
match() is no longer a function+no header, now a static method of InspIRCd class, blah blah blah. Also rip out the 1.2 matcher, as it was slow, and replace it with one adapted from znc, which happens to be a tiny bit faster than 1.1's (and the fastest I've seen so far that works properly)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10212 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 6eda54a9d..ac7c461d6 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -15,7 +15,6 @@ #include "inspircd.h" #include <cstdarg> -#include "wildcard.h" #include "mode.h" Channel::Channel(InspIRCd* Instance, const std::string &cname, time_t ts) : ServerInstance(Instance) @@ -489,11 +488,9 @@ bool Channel::IsBanned(User* user) snprintf(mask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), user->GetIPString()); for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++) { - /* This allows CIDR ban matching - * - * Full masked host Full unmasked host IP with/without CIDR - */ - if ((match(user->GetFullHost(),i->data)) || (match(user->GetFullRealHost(),i->data)) || (match(mask, i->data, true))) + if ((InspIRCd::Match(user->GetFullHost(),i->data, NULL)) || // host + (InspIRCd::Match(user->GetFullRealHost(),i->data, NULL)) || // uncloaked host + (InspIRCd::MatchCIDR(mask, i->data, NULL))) // ip { return true; } @@ -520,7 +517,7 @@ bool Channel::IsExtBanned(const std::string &str, char type) std::string maskptr = i->data.substr(2); ServerInstance->Logs->Log("EXTBANS", DEBUG, "Checking %s against %s, type is %c", str.c_str(), maskptr.c_str(), type); - if (match(str, maskptr)) + if (InspIRCd::Match(str, maskptr, NULL)) return true; } } @@ -1038,7 +1035,7 @@ long Channel::GetMaxBans() /* If there isnt one, we have to do some O(n) hax to find it the first time. (ick) */ for (std::map<std::string,int>::iterator n = ServerInstance->Config->maxbans.begin(); n != ServerInstance->Config->maxbans.end(); n++) { - if (match(this->name,n->first)) + if (InspIRCd::Match(this->name, n->first, NULL)) { this->maxbans = n->second; return n->second; |