]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Add ProtocolInterface::Introduce() to prevent confusion over event ordering, and...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 585af8fe4b2e3fac4ecd1ec384cbcf7fa9e95f4a..b91d76836edaef9ebabb006ecb800f9681dcdcd1 100644 (file)
@@ -50,19 +50,19 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
        {
                I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange,
                I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer,
-               I_OnUserJoin, I_OnChangeHost, I_OnChangeName, I_OnUserPart, I_OnPostConnect,
+               I_OnUserJoin, I_OnChangeHost, I_OnChangeName, I_OnUserPart,
                I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash,
                I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode,
                I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnPostCommand
        };
-       ServerInstance->Modules->Attach(eventlist, this, 28);
+       ServerInstance->Modules->Attach(eventlist, this, 27);
 
        delete ServerInstance->PI;
        ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
 
        for (std::vector<User*>::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++)
        {
-               this->OnPostConnect((*i));
+               ServerInstance->PI->Introduce(*i);
        }
 }
 
@@ -622,31 +622,6 @@ void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, const std::str
        }
 }
 
-void ModuleSpanningTree::OnPostConnect(User* user)
-{
-       if (IS_LOCAL(user))
-       {
-               std::deque<std::string> params;
-               params.push_back(user->uuid);
-               params.push_back(ConvToStr(user->age));
-               params.push_back(user->nick);
-               params.push_back(user->host);
-               params.push_back(user->dhost);
-               params.push_back(user->ident);
-               params.push_back("+"+std::string(user->FormatModes()));
-               params.push_back(user->GetIPString());
-               params.push_back(ConvToStr(user->signon));
-               params.push_back(":"+std::string(user->fullname));
-               Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params);
-       }
-
-       TreeServer* SourceServer = Utils->FindServer(user->server);
-       if (SourceServer)
-       {
-               SourceServer->SetUserCount(1); // increment by 1
-       }
-}
-
 void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
 {
        if ((IS_LOCAL(user)) && (user->registered == REG_ALL))