]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
Allow support for multiple dns results per request. This is a significant change...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index a907bb440464872312e209c8a1979ecf5599790b..c939f2349b90469731032106011090a35fd78b07 100644 (file)
@@ -212,6 +212,9 @@ void TreeSocket::OnError(InspSocketError e)
 {
        Link* MyLink;
 
+       if (this->LinkState == LISTENER)
+               return;
+
        switch (e)
        {
                case I_ERR_CONNECT:
@@ -411,7 +414,7 @@ void TreeSocket::SendError(const std::string &errormessage)
 {
        /* Display the error locally as well as sending it remotely */
        this->WriteLine("ERROR :"+errormessage);
-       this->Instance->SNO->WriteToSnoMask('l',"Sent \2ERROR\2 to "+this->InboundServerName+": "+errormessage);
+       this->Instance->SNO->WriteToSnoMask('l',"Sent \2ERROR\2 to "+ (this->InboundServerName.empty() ? "<unknown>" : this->InboundServerName) +": "+errormessage);
        /* One last attempt to make sure the error reaches its target */
        this->FlushWriteBuffer();
 }
@@ -918,6 +921,7 @@ bool TreeSocket::IntroduceClient(const std::string &source, std::deque<std::stri
 
        time_t age = ConvToInt(params[0]);
        const char* tempnick = params[1].c_str();
+       std::string empty;
 
        cmd_validation valid[] = { {"Nickname", 1, NICKMAX}, {"Hostname", 2, 64}, {"Displayed hostname", 3, 64}, {"Ident", 4, IDENTMAX}, {"GECOS", 7, MAXGECOS}, {"", 0, 0} };
 
@@ -975,11 +979,14 @@ bool TreeSocket::IntroduceClient(const std::string &source, std::deque<std::stri
 
        for (std::string::iterator v = params[5].begin(); v != params[5].end(); v++)
        {
-               _new->modes[(*v)-65] = 1;
                /* For each mode thats set, increase counter */
                ModeHandler* mh = Instance->Modes->FindMode(*v, MODETYPE_USER);
                if (mh)
+               {
+                       mh->OnModeChange(_new, _new, NULL, empty, true);
+                       _new->SetMode(*v, true);
                        mh->ChangeCount(1);
+               }
        }
 
        /* now we've done with modes processing, put the + back for remote servers */