]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cull_list.cpp
Remove some of this, this isn't (strictly speaking) an issue now
[user/henk/code/inspircd.git] / src / cull_list.cpp
index 26f3b4e43ec04964049cddf7185e5db051b39a0f..ddbf6acae8e7d12980c3efeb8a5f69e2418d92d2 100644 (file)
@@ -104,14 +104,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,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(), oper_reason.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,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(), oper_reason.c_str());
                                }
                        }
                        u->AddToWhoWas();
@@ -119,13 +119,22 @@ int CullList::Apply()
 
                if (iter != ServerInstance->Users->clientlist->end())
                {
-                       if (IS_LOCAL(u))
+                       ServerInstance->Users->clientlist->erase(iter);
+               }
+               else
+               {
+                       ServerInstance->Logs->Log("CULLLIST", DEBUG, "iter == clientlist->end, can't remove them from hash... problematic..");
+               }
+
+               if (IS_LOCAL(u))
+               {
+                       std::vector<User*>::iterator x = find(ServerInstance->Users->local_users.begin(),ServerInstance->Users->local_users.end(),u);
+                       if (x != ServerInstance->Users->local_users.end())
+                               ServerInstance->Users->local_users.erase(x);
+                       else
                        {
-                               std::vector<User*>::iterator x = find(ServerInstance->Users->local_users.begin(),ServerInstance->Users->local_users.end(),u);
-                               if (x != ServerInstance->Users->local_users.end())
-                                       ServerInstance->Users->local_users.erase(x);
+                               ServerInstance->Logs->Log("CULLLIST", DEBUG, "Failed to remove user from vector..");
                        }
-                       ServerInstance->Users->clientlist->erase(iter);
                }
 
                delete u;