void XLineManager::ApplyLines()
{
const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
- for (UserManager::LocalList::const_iterator j = list.begin(); j != list.end(); ++j)
+ for (UserManager::LocalList::const_iterator j = list.begin(); j != list.end(); )
{
- LocalUser* u = *j;
+ LocalUser* u = *j++;
// Don't ban people who are exempt.
if (u->exempt)
{
XLine *x = *i;
if (x->Matches(u))
+ {
x->Apply(u);
+
+ // If applying the X-line has killed the user then don't
+ // apply any more lines to them.
+ if (u->quitting)
+ break;
+ }
}
}