]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
Merge pull request #1162 from SaberUK/insp20+fix-deinstall
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index 3e916544bfbadc1ddf7cbd628faa12ce768a332b..c9729cc0f3a6837c96d3d290b1e44c0ad8e9887b 100644 (file)
@@ -157,8 +157,9 @@ void TreeSocket::SendError(const std::string &errormessage)
  */
 void TreeSocket::SquitServer(std::string &from, TreeServer* Current, int& num_lost_servers, int& num_lost_users)
 {
+       std::string servername = Current->GetName();
        ServerInstance->Logs->Log("m_spanningtree",DEBUG,"SquitServer for %s from %s",
-               Current->GetName().c_str(), from.c_str());
+               servername.c_str(), from.c_str());
        /* recursively squit the servers attached to 'Current'.
         * We're going backwards so we don't remove users
         * while we still need them ;)
@@ -188,9 +189,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
                if (!Current->GetSocket() || Current->GetSocket()->Introduced())
                {
                        parameterlist params;
-                       params.push_back(Current->GetName());
+                       params.push_back(Current->GetID());
                        params.push_back(":"+reason);
-                       Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName());
+                       Utils->DoOneToAllButSender(Current->GetParent()->GetID(),"SQUIT",params,Current->GetID());
                }
 
                if (Current->GetParent() == Utils->TreeRoot)
@@ -200,7 +201,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
                }
                else
                {
-                       ServerInstance->SNO->WriteGlobalSno('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
+                       ServerInstance->SNO->WriteToSnoMask('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
                }
                int num_lost_servers = 0;
                int num_lost_users = 0;
@@ -211,8 +212,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
                Current->Tidy();
                Current->GetParent()->DelChild(Current);
                Current->cull();
+               const bool ismyroot = (Current == MyRoot);
                delete Current;
-               if (Current == MyRoot)
+               if (ismyroot)
                {
                        MyRoot = NULL;
                        Close();