From 4fca1ffbc43dd0eda8e6df665dac0fa83512daf8 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 18 Oct 2009 17:58:41 +0000 Subject: More classbase cleanup, hold ConfigTag reference in Autoconnect/Link git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11906 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_helpop.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/modules/m_helpop.cpp') diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index cba630bbc..8f19bd72b 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -104,11 +104,7 @@ class CommandHelpop : public Command user->WriteServ("292 %s : -", user->nick.c_str()); user->WriteServ("292 %s :*** End of HELPOP", user->nick.c_str()); } - - /* We dont want these going out over the network, return CMD_FAILURE - * to make sure the protocol module thinks theyre not worth sending. - */ - return CMD_FAILURE; + return CMD_SUCCESS; } }; @@ -137,10 +133,14 @@ class ModuleHelpop : public Module helpop_map.clear(); - for (int i = 0; i < MyConf.Enumerate("helpop"); i++) + for (int i = 0;; i++) { - irc::string key = assign(MyConf.ReadValue("helpop", "key", i)); - std::string value = MyConf.ReadValue("helpop", "value", i, true); /* Linefeeds allowed! */ + ConfigTag* tag = ServerInstance->Config->ConfValue("helpop", i); + if (!tag) + break; + irc::string key = assign(tag->getString("key")); + std::string value; + tag->readString("value", value, true); /* Linefeeds allowed */ if (key == "index") { @@ -153,12 +153,12 @@ class ModuleHelpop : public Module if (helpop_map.find("start") == helpop_map.end()) { // error! - throw ModuleException("m_helpop: Helpop file is missing important entries. Please check the example conf."); + throw ModuleException("m_helpop: Helpop file is missing important entry 'start'. Please check the example conf."); } else if (helpop_map.find("nohelp") == helpop_map.end()) { // error! - throw ModuleException("m_helpop: Helpop file is missing important entries. Please check the example conf."); + throw ModuleException("m_helpop: Helpop file is missing important entry 'nohelp'. Please check the example conf."); } } @@ -183,7 +183,7 @@ class ModuleHelpop : public Module virtual Version GetVersion() { - return Version("/helpop Command, Works like Unreal helpop", VF_COMMON | VF_VENDOR); + return Version("/helpop Command, Works like Unreal helpop", VF_VENDOR | VF_COMMON); } }; -- cgit v1.2.3