diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-22 01:16:15 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-22 01:16:15 +0000 |
commit | d29a4aea91d371c6a52ab89b7ad87b7ee4236e02 (patch) | |
tree | bf6b2730fc8d4026f8ee0d3cc6217d0b52171c45 | |
parent | 243d8c2907ed4767ad5aa770cee6771be0d9939f (diff) |
Second part of fix for bug #605, make adding and removal of lines not case sensitive
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10590 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/xline.h | 2 | ||||
-rw-r--r-- | src/xline.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/include/xline.h b/include/xline.h index 4be5922d0..886034bba 100644 --- a/include/xline.h +++ b/include/xline.h @@ -439,7 +439,7 @@ typedef std::map<std::string, XLineFactory*> XLineFactMap; /** A map of XLines indexed by string */ -typedef std::map<std::string, XLine *> XLineLookup; +typedef std::map<irc::string, XLine *> XLineLookup; /** A map of XLineLookup maps indexed by string */ 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());*/ |