]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Replace the deprecated MAXBANS token with MAXLIST.
[user/henk/code/inspircd.git] / src / xline.cpp
index 3eb556234d3a12a16bb9cb851725cdc5c4cd65c3..b116d2e1f9eb5859e6e954b9345c4a9784264df8 100644 (file)
@@ -259,7 +259,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 +281,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));
@@ -312,9 +312,7 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User*
 
        y->second->Unset();
 
-       std::vector<XLine*>::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), y->second);
-       if (pptr != pending_lines.end())
-               pending_lines.erase(pptr);
+       stdalgo::erase(pending_lines, y->second);
 
        delete y->second;
        x->second.erase(y);
@@ -419,9 +417,7 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item)
         * is pending, cleared when it is no longer pending, so we skip over this loop if its not pending?
         * -- Brain
         */
-       std::vector<XLine*>::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), item->second);
-       if (pptr != pending_lines.end())
-               pending_lines.erase(pptr);
+       stdalgo::erase(pending_lines, item->second);
 
        delete item->second;
        container->second.erase(item);
@@ -451,7 +447,7 @@ void XLineManager::ApplyLines()
        pending_lines.clear();
 }
 
-void XLineManager::InvokeStats(const std::string &type, int numeric, User* user, string_list &results)
+void XLineManager::InvokeStats(const std::string& type, unsigned int numeric, Stats::Context& stats)
 {
        ContainerIter n = lookup_lines.find(type);
 
@@ -472,7 +468,7 @@ void XLineManager::InvokeStats(const std::string &type, int numeric, User* user,
                                ExpireLine(n, i);
                        }
                        else
-                               results.push_back(ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+
+                               stats.AddRow(numeric, i->second->Displayable()+" "+
                                        ConvToStr(i->second->set_time)+" "+ConvToStr(i->second->duration)+" "+i->second->source+" :"+i->second->reason);
                        i = safei;
                }
@@ -535,7 +531,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
        const std::string banReason = line + "-Lined: " + reason;
 
        if (!ServerInstance->Config->XLineMessage.empty())
-               u->WriteNotice("*** " + ServerInstance->Config->XLineMessage);
+               u->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage);
 
        if (ServerInstance->Config->HideBans)
                ServerInstance->Users->QuitUser(u, line + "-Lined", &banReason);