]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Same here
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index de149e473c0e508c27fa2e758d01ca94fe507851..8ddbe5e309b61614574ed23e3f52d5a36a035387 100644 (file)
@@ -218,17 +218,25 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
                }
        }
 
+
        /*
         * Cancel remote burst mode on any servers which still have it enabled due to latency/lack of data.
         * This prevents lost REMOTECONNECT notices
-        * XXX this should probably not do this until server has been bursting for, say, 60 seconds or something
         */
+       timeval t;
+       gettimeofday(&t, NULL);
+       long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000);
+
        for (server_hash::iterator i = Utils->serverlist.begin(); i != Utils->serverlist.end(); i++)
        {
                if (i->second->bursting)
                {
-                       ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst.", i->second->GetName().c_str());
-                       i->second->FinishBurst();
+                       unsigned long bursttime = ts - i->second->StartBurst;
+                       if (bursttime > 60000) // A minute
+                       {
+                               ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst.", i->second->GetName().c_str());
+                               i->second->FinishBurst();
+                       }
                }
        }
 }
@@ -577,7 +585,7 @@ void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, boo
                        params.push_back(channel->name);
                        params.push_back(ConvToStr(channel->age));
                        params.push_back(std::string("+") + channel->ChanModes(true));
-                       params.push_back(std::string(channel->GetAllPrefixChars(user))+","+std::string(user->uuid));
+                       params.push_back(ServerInstance->Modes->ModeString(user, channel, false)+","+std::string(user->uuid));
                        Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params);
                }
                else