]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Comments
[user/henk/code/inspircd.git] / src / xline.cpp
index ba1ed2249fbb9056eebe8ece1f3ba9070c1833a1..56bd029d7a754b8fefb9f9b3dd8ef1daa35c4d00 100644 (file)
@@ -218,19 +218,30 @@ XLine* XLineManager::MatchesLine(const std::string &type, User* user)
 
        const time_t current = ServerInstance->Time();
 
-       for (LookupIter i = x->second.begin(); i != x->second.end(); i++)
+       LookupIter safei;
+
+       for (LookupIter i = x->second.begin(); i != x->second.end(); )
        {
+               safei = i;
+               safei++;
+
                if (i->second->Matches(user))
                {
                        if (i->second->duration && current > i->second->expiry)
                        {
                                /* Expire the line, return nothing */
                                ExpireLine(x, i);
-                               return NULL;
+                               /* Continue, there may be another that matches
+                                * (thanks aquanight)
+                                */
+                               i = safei;
+                               continue;
                        }
                        else
                                return i->second;
                }
+
+               i = safei;
        }
        return NULL;
 }
@@ -244,19 +255,28 @@ XLine* XLineManager::MatchesLine(const std::string &type, const std::string &pat
 
        const time_t current = ServerInstance->Time();
 
-       for (LookupIter i = x->second.begin(); i != x->second.end(); i++)
+        LookupIter safei;
+
+       for (LookupIter i = x->second.begin(); i != x->second.end(); )
        {
+               safei = i;
+               safei++;
+
                if (i->second->Matches(pattern))
                {
                        if (i->second->duration && current > i->second->expiry)
                        {
                                /* Expire the line, return nothing */
                                ExpireLine(x, i);
-                               return NULL;
+                               /* See above */
+                               i = safei;
+                               continue;
                        }
                        else
                                return i->second;
                }
+
+               i = safei;
        }
        return NULL;
 }
@@ -463,8 +483,8 @@ bool QLine::Matches(User *u)
 
 void QLine::Apply(User* u)
 {       
-       /* Can we force the user to their uid here instead? */
-       DefaultApply(u, "Q");
+       /* Force to uuid on apply of qline, no need to disconnect any more :) */
+       u->ForceNickChange(u->uuid);
 }