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_dnsbl.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_dnsbl.cpp')
-rw-r--r-- | modules/m_dnsbl.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index cf5a2b861..27aaff794 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -93,33 +93,29 @@ class ModuleDNSBL : public Module Implementation i[] = { I_OnReload, I_OnUserConnect }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - OnReload(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; - - this->check_on_connect = config.ReadFlag("m_dnsbl", "check_on_connect", "no", 0); - this->check_on_netburst = config.ReadFlag("m_dnsbl", "check_on_netburst", "no", 0); - this->add_to_akill = config.ReadFlag("m_dnsbl", "add_to_akill", "yes", 0); + this->check_on_connect = reader.ReadFlag("m_dnsbl", "check_on_connect", "no", 0); + this->check_on_netburst = reader.ReadFlag("m_dnsbl", "check_on_netburst", "no", 0); + this->add_to_akill = reader.ReadFlag("m_dnsbl", "add_to_akill", "yes", 0); this->blacklists.clear(); - for (int i = 0, num = config.Enumerate("blacklist"); i < num; ++i) + for (int i = 0, num = reader.Enumerate("blacklist"); i < num; ++i) { - Anope::string bname = config.ReadValue("blacklist", "name", "", i); + Anope::string bname = reader.ReadValue("blacklist", "name", "", i); if (bname.empty()) continue; - Anope::string sbantime = config.ReadValue("blacklist", "time", "4h", i); + Anope::string sbantime = reader.ReadValue("blacklist", "time", "4h", i); time_t bantime = Anope::DoTime(sbantime); if (bantime < 0) bantime = 9000; - Anope::string reason = config.ReadValue("blacklist", "reason", "", i); + Anope::string reason = reader.ReadValue("blacklist", "reason", "", i); std::map<int, Anope::string> replies; for (int j = 0; j < 256; ++j) { - Anope::string k = config.ReadValue("blacklist", stringify(j), "", i); + Anope::string k = reader.ReadValue("blacklist", stringify(j), "", i); if (!k.empty()) replies[j] = k; } |