X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=22086375dd4333261f01dbc54aa00dd109df9314;hb=398e82a1142e8d361b206b4a2b15e3f6325a51b2;hp=bc1cf9183963227dae2fa7ab7b83c09e9d4845c1;hpb=243d8c2907ed4767ad5aa770cee6771be0d9939f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index bc1cf9183..22086375d 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -165,20 +165,20 @@ 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)) + /* If the line exists, check if its an expired line */ + ContainerIter x = lookup_lines.find(line->type); + if (x != lookup_lines.end()) { - /* Line exists, check if its an expired line */ - ContainerIter x = lookup_lines.find(line->type); LookupIter i = x->second.find(line->Displayable()); - - if (i->second->duration && ServerInstance->Time() > i->second->expiry) - ExpireLine(x, i); - else - return false; + 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());*/