]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Use loopCall to protect OnUserKick rather than the triggerevents hack
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index ad51f4019a41056a29df24689911c4fff72cb9cf..b38929ad00b2b6a935aa5f80c36964cf7c0fdf0e 100644 (file)
@@ -58,6 +58,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
 
        delete ServerInstance->PI;
        ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
+       loopCall = false;
 
        for (std::vector<User*>::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++)
        {
@@ -195,7 +196,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
                // Fix for bug #792, do not ping servers that are not connected yet!
                // Remote servers have Socket == NULL and local connected servers have
                // Socket->LinkState == CONNECTED
-               if (!s->GetSocket() || s->GetSocket()->GetLinkState() == CONNECTED)
+               if (s->GetSocket() && s->GetSocket()->GetLinkState() != CONNECTED)
                        continue;
 
                // Now do PING checks on all servers
@@ -676,6 +677,8 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
 
 void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
 {
+       if (loopCall)
+               return;
        if ((source) && (IS_LOCAL(source)))
        {
                std::deque<std::string> params;
@@ -769,7 +772,7 @@ void ModuleSpanningTree::OnOper(User* user, const std::string &opertype)
 
 void ModuleSpanningTree::OnAddLine(User* user, XLine *x)
 {
-       if (!x->IsBurstable())
+       if (!x->IsBurstable() || loopCall)
                return;
 
        char data[MAXBUF];