diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-28 19:20:44 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-28 19:20:44 +0000 |
commit | 3f29514c37f8df97091cd3bbe02a6c01f4098e16 (patch) | |
tree | 9d2ea53046964fad8f9bf771370f6bdc968e0dfd /src/xline.cpp | |
parent | 7361ed672ee1347933c55ea2bed4d08ef2312885 (diff) |
Add a virtual Matches to XLine class, and override it appropriately for all derived classes. Most still need to be converted to use it, however. This will make ApplyLines change much easier than it is currently ..
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8403 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 1387ac755..eca06b06d 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -486,13 +486,8 @@ KLine* XLineManager::matches_kline(User* user) for (std::vector<KLine*>::iterator i = klines.begin(); i != klines.end(); i++) { - if ((match(user->ident,(*i)->identmask))) - { - if ((match(user->host,(*i)->hostmask, true)) || (match(user->GetIPString(),(*i)->hostmask, true))) - { - return (*i); - } - } + if ((*i)->Matches(user)) + return (*i); } return NULL; @@ -666,3 +661,40 @@ void XLineManager::stats_e(User* user, string_list &results) XLineManager::XLineManager(InspIRCd* Instance) : ServerInstance(Instance) { } + + + +bool KLine::Matches(User *u) +{ + if ((match(u->ident, this->identmask))) + { + if ((match(u->host, this->hostmask, true)) || (match(u->GetIPString(), this->hostmask, true))) + { + return true; + } + } + + return false; +} + +bool GLine::Matches(User *u) +{ + return false; +} + +bool ELine::Matches(User *u) +{ + return false; +} + +bool ZLine::Matches(User *u) +{ + return false; +} + +bool QLine::Matches(User *u) +{ + return false; +} + + |