X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcull_list.cpp;h=07649ed819b173240c1563bb107e7273506295ec;hb=6eeecaada5818d8dc1f3bb98c3e0916d195e3592;hp=abefa8b5750fc8ec059aefd552597936acba40cf;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cull_list.cpp b/src/cull_list.cpp index abefa8b57..07649ed81 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -18,7 +18,6 @@ CullList::CullList(InspIRCd* Instance) : ServerInstance(Instance) { - list.clear(); } void CullList::AddItem(User* user) @@ -32,23 +31,13 @@ void CullList::MakeSilent(User* user) return; } -int CullList::Apply() +void CullList::Apply() { - int n = list.size(); - int i = 0; - - while (list.size() && i++ != 100) + for(std::vector::iterator a = list.begin(); a != list.end(); a++) { - std::vector::iterator a = list.begin(); - - User *u = (*a); - user_hash::iterator iter = ServerInstance->Users->clientlist->find(u->nick); - const std::string& preset_reason = u->GetOperQuit(); - std::string reason; - std::string oper_reason; - - reason.assign(u->quitmsg, 0, ServerInstance->Config->Limits.MaxQuit); - oper_reason.assign(preset_reason.empty() ? preset_reason : u->operquitmsg, 0, ServerInstance->Config->Limits.MaxQuit); + User *u = *a; + // user has been moved onto their UID; that's why this isn't find(u->nick) + user_hash::iterator iter = ServerInstance->Users->clientlist->find(u->uuid); if (u->registered != REG_ALL) if (ServerInstance->Users->unregistered_count) @@ -58,19 +47,7 @@ int CullList::Apply() { if (!u->sendq.empty()) u->FlushWriteBuf(); - } - - if (u->registered == REG_ALL) - { - FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(u, reason, oper_reason)); - u->PurgeEmptyChannels(); - u->WriteCommonQuit(reason, oper_reason); - } - FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(u)); - - if (IS_LOCAL(u)) - { if (u->GetIOHook()) { try @@ -97,14 +74,14 @@ int CullList::Apply() { if (!u->quietquit) { - ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]", u->nick.c_str(), u->ident.c_str(), u->host.c_str(), oper_reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]", u->nick.c_str(), u->ident.c_str(), u->host.c_str(), u->operquitmsg.c_str()); } } else { if ((!ServerInstance->SilentULine(u->server)) && (!u->quietquit)) { - ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]", u->server, u->nick.c_str(), u->ident.c_str(), u->host.c_str(), oper_reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]", u->server, u->nick.c_str(), u->ident.c_str(), u->host.c_str(), u->operquitmsg.c_str()); } } u->AddToWhoWas(); @@ -131,9 +108,7 @@ int CullList::Apply() } delete u; - list.erase(list.begin()); } - - return n; + list.clear(); }