]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Fix SpanningTreeProtocolInterface::SendChannelPrivmsg() and SendChannelNotice() sendi...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index d702ab4a25c9d93e497a5283c945de4c5dc3cc85..967b577b15d03f466df3f3df81f7d29857d8f7ae 100644 (file)
@@ -88,7 +88,7 @@ void ModuleSpanningTree::init()
        loopCall = false;
 
        // update our local user count
-       Utils->TreeRoot->SetUserCount(ServerInstance->Users->local_users.size());
+       Utils->TreeRoot->SetUserCount(ServerInstance->Users->LocalUserCount());
 }
 
 void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
@@ -806,6 +806,7 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod)
 {
        ServerInstance->PI->SendMetaData(NULL, "modules", "-" + mod->ModuleSourceFile);
 
+restart:
        unsigned int items = Utils->TreeRoot->ChildCount();
        for(unsigned int x = 0; x < items; x++)
        {
@@ -815,6 +816,8 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod)
                {
                        sock->SendError("SSL module unloaded");
                        sock->Close();
+                       // XXX: The list we're iterating is modified by TreeSocket::Squit() which is called by Close()
+                       goto restart;
                }
        }
 
@@ -927,6 +930,12 @@ ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg)
        return MOD_RES_PASSTHRU;
 }
 
+void ModuleSpanningTree::OnRequest(Request& request)
+{
+       if (!strcmp(request.id, "rehash"))
+               Utils->Rehash();
+}
+
 void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const parameterlist &modeline, const std::vector<TranslateType> &translate)
 {
        TreeSocket* s = (TreeSocket*)opaque;