]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Add support for hashed WebIRC passwords to m_cgiirc.
[user/henk/code/inspircd.git] / src / xline.cpp
index 30a1d7c9cc97428904084c1115779c6f0fc2dce0..257af9ca7a72ba4a63b6b64a8910fa722761e3ad 100644 (file)
@@ -159,6 +159,7 @@ void XLineManager::CheckELines()
        for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++)
        {
                LocalUser* u = *u2;
+               u->exempt = false;
 
                /* This uses safe iteration to ensure that if a line expires here, it doenst trash the iterator */
                LookupIter safei;
@@ -169,7 +170,8 @@ void XLineManager::CheckELines()
                        safei++;
 
                        XLine *e = i->second;
-                       u->exempt = e->Matches(u);
+                       if ((!e->duration || ServerInstance->Time() < e->expiry) && e->Matches(u))
+                               u->exempt = true;
 
                        i = safei;
                }
@@ -259,7 +261,7 @@ bool XLineManager::AddLine(XLine* line, User* user)
        ContainerIter x = lookup_lines.find(line->type);
        if (x != lookup_lines.end())
        {
-               LookupIter i = x->second.find(line->Displayable().c_str());
+               LookupIter i = x->second.find(line->Displayable());
                if (i != x->second.end())
                {
                        // XLine propagation bug was here, if the line to be added already exists and
@@ -281,7 +283,7 @@ bool XLineManager::AddLine(XLine* line, User* user)
        if (xlf->AutoApplyToUserList(line))
                pending_lines.push_back(line);
 
-       lookup_lines[line->type][line->Displayable().c_str()] = line;
+       lookup_lines[line->type][line->Displayable()] = line;
        line->OnAdd();
 
        FOREACH_MOD(OnAddLine, (user, line));
@@ -323,14 +325,6 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User*
 
 void ELine::Unset()
 {
-       /* remove exempt from everyone and force recheck after deleting eline */
-       const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
-       for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++)
-       {
-               LocalUser* u = *u2;
-               u->exempt = false;
-       }
-
        ServerInstance->XLines->CheckELines();
 }