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/commands/cs_xop.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/commands/cs_xop.cpp')
-rw-r--r-- | modules/commands/cs_xop.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 1cfa033e2..32253770f 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -543,36 +543,33 @@ class CSXOP : public Module accessprovider(this), commandcsxop(this) { this->SetPermanent(true); - - this->OnReload(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { order.clear(); permissions.clear(); - ConfigReader config; - for (int i = 0; i < config.Enumerate("privilege"); ++i) + for (int i = 0; i < reader.Enumerate("privilege"); ++i) { - const Anope::string &pname = config.ReadValue("privilege", "name", "", i); + const Anope::string &pname = reader.ReadValue("privilege", "name", "", i); Privilege *p = PrivilegeManager::FindPrivilege(pname); if (p == NULL) continue; - const Anope::string &xop = config.ReadValue("privilege", "xop", "", i); + const Anope::string &xop = reader.ReadValue("privilege", "xop", "", i); if (xop.empty()) continue; permissions[xop].push_back(pname); } - for (int i = 0; i < config.Enumerate("command"); ++i) + for (int i = 0; i < reader.Enumerate("command"); ++i) { - const Anope::string &cname = config.ReadValue("command", "name", "", i), - &cserv = config.ReadValue("command", "command", "", i); + const Anope::string &cname = reader.ReadValue("command", "name", "", i), + &cserv = reader.ReadValue("command", "command", "", i); if (cname.empty() || cserv != "chanserv/xop") continue; |