]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Find the right variable so it actually works, too.
[user/henk/code/inspircd.git] / src / xline.cpp
index da46c2eee44926beb4d05635349280b4d58ce1a7..0424e7a09ff7482f73c2b2ab0a8f3fe8cb25a5c9 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -18,7 +18,7 @@
 #include "bancache.h"
 
 /*
- * This is now version 3 of the XLine subsystem, let's see if we can get it as nice and 
+ * This is now version 3 of the XLine subsystem, let's see if we can get it as nice and
  * efficient as we can this time so we can close this file and never ever touch it again ..
  *
  * Background:
@@ -167,17 +167,17 @@ bool XLineManager::AddLine(XLine* line, User* user)
 {
        ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
 
-       /* If the line exists, check if its an expired line */
+       if (line->duration && ServerInstance->Time() > line->expiry)
+               return false; // Don't apply expired XLines.
+
+       /* Don't apply duplicate xlines */
        ContainerIter x = lookup_lines.find(line->type);
        if (x != lookup_lines.end())
        {
                LookupIter i = x->second.find(line->Displayable());
                if (i != x->second.end())
                {
-                       if (i->second->duration && ServerInstance->Time() > i->second->expiry)
-                               ExpireLine(x, i);
-                       else
-                               return false;
+                       return false;
                }
        }
 
@@ -192,7 +192,7 @@ bool XLineManager::AddLine(XLine* line, User* user)
        lookup_lines[line->type][line->Displayable()] = line;
        line->OnAdd();
 
-       FOREACH_MOD(I_OnAddLine,OnAddLine(user, line)); 
+       FOREACH_MOD(I_OnAddLine,OnAddLine(user, line));
 
        return true;
 }
@@ -342,6 +342,10 @@ void XLineManager::ApplyLines()
        {
                User* u = (User*)(*u2);
 
+               // Don't ban people who are exempt.
+               if (u->exempt)
+                       continue;
+
                for (std::vector<XLine *>::iterator i = pending_lines.begin(); i != pending_lines.end(); i++)
                {
                        XLine *x = *i;
@@ -423,7 +427,7 @@ XLineManager::~XLineManager()
                i->second.clear();
        }
        lookup_lines.clear();
-       
+
 }
 
 void XLine::Apply(User* u)
@@ -498,7 +502,7 @@ bool GLine::Matches(User *u)
 }
 
 void GLine::Apply(User* u)
-{       
+{
        DefaultApply(u, "G", (strcmp(this->identmask, "*") == 0) ? true : false);
 }
 
@@ -531,7 +535,7 @@ bool ZLine::Matches(User *u)
 }
 
 void ZLine::Apply(User* u)
-{       
+{
        DefaultApply(u, "Z", true);
 }
 
@@ -545,7 +549,7 @@ bool QLine::Matches(User *u)
 }
 
 void QLine::Apply(User* u)
-{       
+{
        /* Force to uuid on apply of qline, no need to disconnect any more :) */
        u->ForceNickChange(u->uuid.c_str());
 }
@@ -681,4 +685,3 @@ XLineFactory* XLineManager::GetFactory(const std::string &type)
 
        return n->second;
 }
-