diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-08-16 12:10:55 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-08-30 13:15:10 +0200 |
commit | c202dea024542b9c6c6b771bb9a3a081d9eacdc5 (patch) | |
tree | 64f4d5f5c18e685d3cd360107664eec644d5585d /src/modules/m_spanningtree | |
parent | 1031f333332cf1b09db4fd632f141143ee637c34 (diff) |
Replace OnRehash() with ReadConfig() that is called on boot, on module load and on rehash
This eliminates the need for calling OnRehash() in init()
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 9ece3c03d..1e59e1607 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -618,7 +618,7 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) } } -void ModuleSpanningTree::OnRehash(User* user) +void ModuleSpanningTree::ReadConfig(ConfigStatus& status) { // Re-read config stuff try @@ -633,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); } } diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index f03a36db2..10f698f22 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -142,7 +142,7 @@ class ModuleSpanningTree : public Module void OnUserPostNick(User* user, const std::string &oldnick) CXX11_OVERRIDE; void OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts) CXX11_OVERRIDE; void OnPreRehash(User* user, const std::string ¶meter) CXX11_OVERRIDE; - void OnRehash(User* user) CXX11_OVERRIDE; + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE; void OnOper(User* user, const std::string &opertype) CXX11_OVERRIDE; void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason); void OnAddLine(User *u, XLine *x) CXX11_OVERRIDE; diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 40db1339c..0ec0a57f9 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -131,8 +131,6 @@ SpanningTreeUtilities::SpanningTreeUtilities(ModuleSpanningTree* C) : Creator(C), TreeRoot(NULL) { ServerInstance->Timers->AddTimer(&RefreshTimer); - - this->ReadConfiguration(); } CullResult SpanningTreeUtilities::cull() |