X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=b74fda3cf021152c989d3fa36e0fa495252b5d20;hb=325beda3540fdd8f8e13f90866a372d07ec71620;hp=63a64d6b9d74d2b9ab73a4e38c8702f37b3c990b;hpb=e244cb2c63b1ac1d85bdbb4691f7b1bd940ae804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index 63a64d6b9..b74fda3cf 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -23,7 +23,6 @@ #include "inspircd.h" #include "xline.h" -#include "bancache.h" /** An XLineFactory specialized to generate GLine* pointers */ @@ -276,7 +275,7 @@ bool XLineManager::AddLine(XLine* line, User* user) if (!xlf) return false; - ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here? + ServerInstance->BanCache.RemoveEntries(line->type, false); // XXX perhaps remove ELines here? if (xlf->AutoApplyToUserList(line)) pending_lines.push_back(line); @@ -306,7 +305,7 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User* if (simulate) return true; - ServerInstance->BanCache->RemoveEntries(y->second->type, true); + ServerInstance->BanCache.RemoveEntries(y->second->type, true); FOREACH_MOD(OnDelLine, (user, y->second)); @@ -430,10 +429,10 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item) // applies lines, removing clients and changing nicks etc as applicable void XLineManager::ApplyLines() { - LocalUserList::reverse_iterator u2 = ServerInstance->Users->local_users.rbegin(); - while (u2 != ServerInstance->Users->local_users.rend()) + LocalUserList& list = ServerInstance->Users->local_users; + for (LocalUserList::iterator j = list.begin(); j != list.end(); ++j) { - LocalUser* u = *u2++; + LocalUser* u = *j; // Don't ban people who are exempt. if (u->exempt) @@ -471,7 +470,7 @@ void XLineManager::InvokeStats(const std::string &type, int numeric, User* user, ExpireLine(n, i); } else - results.push_back(ServerInstance->Config->ServerName+" "+ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+ + results.push_back(ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+ ConvToStr(i->second->set_time)+" "+ConvToStr(i->second->duration)+" "+i->second->source+" :"+i->second->reason); i = safei; } @@ -545,7 +544,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache) if (bancache) { ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString()); - ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, banReason, this->duration); + ServerInstance->BanCache.AddHit(u->GetIPString(), this->type, banReason, this->duration); } } @@ -642,7 +641,7 @@ bool QLine::Matches(User *u) void QLine::Apply(User* u) { /* Force to uuid on apply of qline, no need to disconnect any more :) */ - u->ForceNickChange(u->uuid); + u->ChangeNick(u->uuid); }