summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 19:35:58 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-28 19:35:58 +0000
commitfd568fb528e3de8a2b7d8e22faab632d85e61aec (patch)
treea80dbecd079ca072f4d09dd162af549c25d2066c /src/xline.cpp
parenta87326fb1759a9b96de8b0a0842bba1d4177e04e (diff)
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
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp36
1 files changed, 20 insertions, 16 deletions
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<GLine*>::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<ELine*>::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;
}