]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Replace OnRehash() with ReadConfig() that is called on boot, on module load and on...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index f458c2d2f86a44aff9811159f301a03d8726e368..1e59e1607c52ff83eab584af002d535d4cfa1a65 100644 (file)
@@ -422,10 +422,7 @@ void ModuleSpanningTree::OnPostTopicChange(User* user, Channel* chan, const std:
        if (!IS_LOCAL(user))
                return;
 
-       CmdBuilder params(user->uuid, "TOPIC");
-       params.push_back(chan->name);
-       params.push_last(topic);
-       params.Broadcast();
+       CommandFTopic::Builder(user, chan).Broadcast();
 }
 
 void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, const std::string& text, char status, const CUList& exempt_list, MessageType msgtype)
@@ -621,7 +618,7 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
        }
 }
 
-void ModuleSpanningTree::OnRehash(User* user)
+void ModuleSpanningTree::ReadConfig(ConfigStatus& status)
 {
        // Re-read config stuff
        try
@@ -636,7 +633,7 @@ void ModuleSpanningTree::OnRehash(User* user)
                std::string msg = "Error in configuration: ";
                msg.append(e.GetReason());
                ServerInstance->SNO->WriteToSnoMask('l', msg);
-               if (user && !IS_LOCAL(user))
+               if (status.srcuser && !IS_LOCAL(status.srcuser))
                        ServerInstance->PI->SendSNONotice("L", msg);
        }
 }
@@ -672,6 +669,13 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod)
                        sock->Close();
                }
        }
+
+       for (SpanningTreeUtilities::TimeoutList::const_iterator i = Utils->timeoutlist.begin(); i != Utils->timeoutlist.end(); ++i)
+       {
+               TreeSocket* sock = i->first;
+               if (sock->GetIOHook() && sock->GetIOHook()->creator == mod)
+                       sock->Close();
+       }
 }
 
 // note: the protocol does not allow direct umode +o except