]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Improve UserManager::QuitUser() and related code
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 8d8a51ede496e1f43f40146884669499ad17ec47..8c04d6c909797cacebf09dbcbdb7c34d6ee7bd51 100644 (file)
@@ -63,6 +63,7 @@ void ModuleSpanningTree::init()
        delete ServerInstance->PI;
        ServerInstance->PI = new SpanningTreeProtocolInterface;
        loopCall = false;
+       SplitInProgress = false;
 
        // update our local user count
        Utils->TreeRoot->UserCount = ServerInstance->Users->local_users.size();
@@ -547,13 +548,25 @@ void ModuleSpanningTree::OnUserPart(Membership* memb, std::string &partmessage,
 
 void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
 {
-       if ((IS_LOCAL(user)) && (user->registered == REG_ALL))
+       if (IS_LOCAL(user))
        {
                if (oper_message != reason)
                        ServerInstance->PI->SendMetaData(user, "operquit", oper_message);
 
                CmdBuilder(user, "QUIT").push_last(reason).Broadcast();
        }
+       else
+       {
+               // Hide the message if one of the following is true:
+               // - User is being quit due to a netsplit and quietbursts is on
+               // - Server is a silent uline
+               bool hide = (((this->SplitInProgress) && (Utils->quiet_bursts)) || (ServerInstance->SilentULine(user->server)));
+               if (!hide)
+               {
+                       ServerInstance->SNO->WriteToSnoMask('Q', "Client exiting on server %s: %s (%s) [%s]",
+                               user->server.c_str(), user->GetFullRealHost().c_str(), user->GetIPString().c_str(), oper_message.c_str());
+               }
+       }
 
        // Regardless, We need to modify the user Counts..
        TreeServer* SourceServer = Utils->FindServer(user->server);