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/extra/m_dns.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/extra/m_dns.cpp')
| -rw-r--r-- | modules/extra/m_dns.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/extra/m_dns.cpp b/modules/extra/m_dns.cpp index 3ee7aaa67..e8f3bd758 100644 --- a/modules/extra/m_dns.cpp +++ b/modules/extra/m_dns.cpp @@ -938,21 +938,18 @@ class ModuleDNS : public Module Implementation i[] = { I_OnReload, I_OnModuleUnload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - this->OnReload(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; - - nameserver = config.ReadValue("dns", "nameserver", "127.0.0.1", 0); - timeout = Anope::DoTime(config.ReadValue("dns", "timeout", "5", 0)); - ip = config.ReadValue("dns", "ip", "0.0.0.0", 0); - port = config.ReadInteger("dns", "port", "53", 0, false); - admin = config.ReadValue("dns", "admin", "admin@example.com", 0); - nameservers = config.ReadValue("dns", "nameservers", "ns1.example.com", 0); - refresh = config.ReadInteger("dns", "refresh", "3600", 0, false); + + nameserver = reader.ReadValue("dns", "nameserver", "127.0.0.1", 0); + timeout = Anope::DoTime(reader.ReadValue("dns", "timeout", "5", 0)); + ip = reader.ReadValue("dns", "ip", "0.0.0.0", 0); + port = reader.ReadInteger("dns", "port", "53", 0, false); + admin = reader.ReadValue("dns", "admin", "admin@example.com", 0); + nameservers = reader.ReadValue("dns", "nameservers", "ns1.example.com", 0); + refresh = reader.ReadInteger("dns", "refresh", "3600", 0, false); if (Anope::IsFile(nameserver)) { |
