]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Second part of fix for bug #605, make adding and removal of lines not case sensitive
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 22 Sep 2008 01:16:15 +0000 (01:16 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 22 Sep 2008 01:16:15 +0000 (01:16 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10590 e03df62e-2008-0410-955e-edbf42e46eb7

include/xline.h
src/xline.cpp

index 4be5922d096543e6a095193696165297f06279a8..886034bbafd81df76658a621dc28bf3b9ea0ef8e 100644 (file)
@@ -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
  */
index bc1cf9183963227dae2fa7ab7b83c09e9d4845c1..22086375dd4333261f01dbc54aa00dd109df9314 100644 (file)
@@ -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());*/