]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cull_list.cpp
Re-add support for silent quits (note: we also remove an O(n) doing it this way)
[user/henk/code/inspircd.git] / src / cull_list.cpp
index 9a3c088e81e95d7fd9e75a487ef40399afeb72b2..2b769e893247402d4f0120e3dff4ea67f6aa6de4 100644 (file)
@@ -33,15 +33,7 @@ void CullList::AddItem(User* user)
 
 void CullList::MakeSilent(User* user)
 {
-/*     for (std::vector<CullItem *>::iterator a = list.begin(); a != list.end(); ++a)
-       {
-               if ((*a)->GetUser() == user)
-               {
-                       (*a)->MakeSilent();
-                       break;
-               }
-       }
-*/
+       user->quietquit = true;
        return;
 }
 
@@ -111,18 +103,17 @@ int CullList::Apply()
                {
                        if (IS_LOCAL(u))
                        {
-       // XXX
-       //                      if (!(*a)->IsSilent())
-       //                      {
-       //                              ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",u->nick,u->ident,u->host,oper_reason.c_str());
-       //                      }
+                               if (!u->quietquit)
+                               {
+                                       ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",u->nick,u->ident,u->host,oper_reason.c_str());
+                               }
                        }
                        else
                        {
-       //                      if ((!ServerInstance->SilentULine(u->server)) && (!(*a)->IsSilent()))
-       //                      {
+                               if ((!ServerInstance->SilentULine(u->server)) && (!u->quietquit))
+                               {
                                        ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",u->server,u->nick,u->ident,u->host,oper_reason.c_str());
-       //                      }
+                               }
                        }
                        u->AddToWhoWas();
                }
@@ -136,13 +127,13 @@ int CullList::Apply()
                                        ServerInstance->local_users.erase(x);
                        }
                        ServerInstance->clientlist->erase(iter);
-                       delete u;
                }
 
-       //      delete *list.begin();
+               delete u;
                list.erase(list.begin());
                exempt.erase(exemptiter);
        }
+
        return n;
 }