X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=22086375dd4333261f01dbc54aa00dd109df9314;hb=b5d21fdb6572021ab4c79d19b753d0b108c93750;hp=0c6965fe31b03b7f8aaac6b1a30c5be035ae180f;hpb=a8a36c9935af638dc4411734695d60bf4b28fd8a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index 0c6965fe3..22086375d 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -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);