]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Apply patch from jmb, for bug #593. Snotices on override are now sent regardless...
[user/henk/code/inspircd.git] / src / xline.cpp
index b74072bff090ecd6ae8107c0d817e68ad1819df3..22086375dd4333261f01dbc54aa00dd109df9314 100644 (file)
@@ -165,12 +165,21 @@ IdentHostPair XLineManager::IdentSplit(const std::string &ident_and_host)
 
 bool XLineManager::AddLine(XLine* line, User* user)
 {
-       /*IdentHostPair ih = IdentSplit(hostmask);*/
-
        ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
 
-       if (DelLine(line->Displayable(), line->type, user, true))
-               return false;
+       /* If the line exists, check if its an expired line */
+       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;
+               }
+       }
 
        /*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
        XLineFactory* xlf = GetFactory(line->type);
@@ -532,9 +541,6 @@ void ZLine::Apply(User* u)
 
 bool QLine::Matches(User *u)
 {
-       if (u->exempt)
-               return false;
-
        if (InspIRCd::Match(u->nick, this->nick))
                return true;