]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
m_spanningtree Add TreeSocket::WriteLineNoCompat() to send a line without doing any...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index 3df0bdee88ff88a8ade2ea7966101e06e52827ec..e5989bd2839a4acccf6c455fdf3e21e6409994b8 100644 (file)
@@ -168,18 +168,8 @@ void TreeSocket::ProcessLine(std::string &line)
                                if (!CheckDuplicate(capab->name, capab->sid))
                                        return;
 
-                               this->LinkState = CONNECTED;
-                               Utils->timeoutlist.erase(this);
+                               FinishAuth(capab->name, capab->sid, capab->description, capab->hidden);
 
-                               linkID = capab->name;
-
-                               MyRoot = new TreeServer(capab->name, capab->description, capab->sid, Utils->TreeRoot, this, capab->hidden);
-                               Utils->TreeRoot->AddChild(MyRoot);
-
-                               MyRoot->bursting = true;
-                               this->DoBurst(MyRoot);
-
-                               CommandServer::Builder(MyRoot).Forward(MyRoot);
                                CmdBuilder(MyRoot->GetID(), "BURST").insert(params).Forward(MyRoot);
                        }
                        else if (command == "ERROR")
@@ -380,3 +370,17 @@ void TreeSocket::Close()
                }
        }
 }
+
+void TreeSocket::FinishAuth(const std::string& remotename, const std::string& remotesid, const std::string& remotedesc, bool hidden)
+{
+       this->LinkState = CONNECTED;
+       Utils->timeoutlist.erase(this);
+
+       linkID = remotename;
+
+       MyRoot = new TreeServer(remotename, remotedesc, remotesid, Utils->TreeRoot, this, hidden);
+
+       this->DoBurst(MyRoot);
+
+       CommandServer::Builder(MyRoot).Forward(MyRoot);
+}