diff options
author | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
commit | 4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch) | |
tree | 43162205d31b277c9ff12ee28b7e3a60d6382316 /modules/m_rewrite.cpp | |
parent | 207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff) |
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'modules/m_rewrite.cpp')
-rw-r--r-- | modules/m_rewrite.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/m_rewrite.cpp b/modules/m_rewrite.cpp index 1e281de94..fb7fe46ed 100644 --- a/modules/m_rewrite.cpp +++ b/modules/m_rewrite.cpp @@ -155,30 +155,26 @@ class ModuleRewrite : public Module public: ModuleRewrite(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), cmdrewrite(this) { - Implementation i[] = { I_OnReload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - this->OnReload(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; Rewrite::rewrites.clear(); - for (int i = 0; i < config.Enumerate("command"); ++i) + for (int i = 0; i < reader.Enumerate("command"); ++i) { - if (!config.ReadFlag("command", "rewrite", "no", i)) + if (!reader.ReadFlag("command", "rewrite", "no", i)) continue; Rewrite rw; - rw.client = config.ReadValue("command", "service", "", i); - rw.source_message = config.ReadValue("command", "rewrite_source", "", i), - rw.target_message = config.ReadValue("command", "rewrite_target", "", i); - rw.desc = config.ReadValue("command", "rewrite_description", "", i); + rw.client = reader.ReadValue("command", "service", "", i); + rw.source_message = reader.ReadValue("command", "rewrite_source", "", i), + rw.target_message = reader.ReadValue("command", "rewrite_target", "", i); + rw.desc = reader.ReadValue("command", "rewrite_description", "", i); if (rw.client.empty() || rw.source_message.empty() || rw.target_message.empty()) continue; |