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;
}
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;
}
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);
}