X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=b116d2e1f9eb5859e6e954b9345c4a9784264df8;hb=8db52f66a2ff587457c34889b31e7ef70876c7fa;hp=3eb556234d3a12a16bb9cb851725cdc5c4cd65c3;hpb=e5ada400b0f2e2ae02f40867450a6789126da6e3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index 3eb556234..b116d2e1f 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -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::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::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);