From fd568fb528e3de8a2b7d8e22faab632d85e61aec Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 28 Oct 2007 19:35:58 +0000 Subject: Make E:Line/G:Line use the Matches stuff git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8407 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/xline.cpp b/src/xline.cpp index 857c54069..17acb0272 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -371,13 +371,8 @@ GLine* XLineManager::matches_gline(User* user) for (std::vector::iterator i = glines.begin(); i != glines.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; @@ -387,18 +382,11 @@ ELine* XLineManager::matches_exception(User* user) { if (elines.empty()) return NULL; - char host2[MAXBUF]; - snprintf(host2,MAXBUF,"*@%s",user->host); for (std::vector::iterator i = elines.begin(); i != elines.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; } @@ -679,11 +667,27 @@ bool KLine::Matches(User *u) bool GLine::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 ELine::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; } -- cgit v1.2.3