diff options
author | Adam <Adam@anope.org> | 2013-05-05 01:55:04 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-05 01:55:04 -0400 |
commit | 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b (patch) | |
tree | 4486f0784bdf050fd7eb225c0cb9df352ce1f45a /modules/commands/ns_set_misc.cpp | |
parent | 781defb7076ddfddf723ca08cd0a518b6657b64f (diff) |
Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in.
Diffstat (limited to 'modules/commands/ns_set_misc.cpp')
-rw-r--r-- | modules/commands/ns_set_misc.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 5ee77a938..871a1191f 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -161,17 +161,21 @@ class NSSetMisc : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } - void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override + void OnReload(Configuration::Conf *conf) anope_override { descriptions.clear(); - for (int i = 0; i < reader.Enumerate("command"); ++i) + for (int i = 0; i < conf->CountBlock("command"); ++i) { - if (reader.ReadValue("command", "command", "", i) != "nickserv/set/misc" && reader.ReadValue("command", "command", "", i) != "nickserv/saset/misc") + Configuration::Block *block = conf->GetBlock("command", i); + + const Anope::string &cmd = block->Get<const Anope::string &>("command"); + + if (cmd != "nickserv/set/misc" && cmd != "nickserv/saset/misc") continue; - Anope::string cname = reader.ReadValue("command", "name", "", i); - Anope::string desc = reader.ReadValue("command", "misc_description", "", i); + Anope::string cname = block->Get<const Anope::string &>("name"); + Anope::string desc = block->Get<const Anope::string &>("misc_description"); if (cname.empty() || desc.empty()) continue; |