From 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 01:55:04 -0400 Subject: Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. --- modules/commands/ns_set_misc.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'modules/commands/ns_set_misc.cpp') 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("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("name"); + Anope::string desc = block->Get("misc_description"); if (cname.empty() || desc.empty()) continue; -- cgit