From d70ae11ab22d10e40cae525ff28022e596a7c6f0 Mon Sep 17 00:00:00 2001 From: frostycoolslug Date: Wed, 25 May 2005 05:54:59 +0000 Subject: Added ability to update the helpop file on rehash (Bug #69) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1512 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_helpop.cpp | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index bbc64b783..7331db0a8 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -139,25 +139,8 @@ class ModuleHelpop : public Module ModuleHelpop() { Srv = new Server; - conf = new ConfigReader; - - h_file = conf->ReadValue("helpop", "file", 0); - - if (h_file == "") { - log(DEFAULT,"m_helpop: Helpop file not Specified."); - return; - } - - helpop = new ConfigReader(h_file); - - if ((helpop->ReadValue("nohelp", "line1", 0) == "") || - (helpop->ReadValue("nohelpo", "line1", 0) == "") || - (helpop->ReadValue("start", "line1", 0) == "")) - { - log(DEFAULT,"m_helpop: Helpop file is missing important entries. Please check the example conf."); - return; - } + ReadConfig(); if (!Srv->AddExtendedMode('h',MT_CLIENT,true,0,0)) { Srv->Log(DEFAULT,"Unable to claim the +h usermode."); @@ -166,6 +149,35 @@ class ModuleHelpop : public Module // Loads of comments, untill supported properly. Srv->AddCommand("HELPOP",handle_helpop,0,0,"m_helpop.so"); + } + + virtual void ReadConfig() + { + conf = new ConfigReader; + h_file = conf->ReadValue("helpop", "file", 0); + + if (h_file == "") { + log(DEFAULT,"m_helpop: Helpop file not Specified."); + return; + } + + helpop = new ConfigReader(h_file); + if ((helpop->ReadValue("nohelp", "line1", 0) == "") || + (helpop->ReadValue("nohelpo", "line1", 0) == "") || + (helpop->ReadValue("start", "line1", 0) == "")) + { + log(DEFAULT,"m_helpop: Helpop file is missing important entries. Please check the example conf."); + return; + } + } + + + virtual void OnRehash() + { + delete conf; + delete helpop; + + ReadConfig(); } -- cgit v1.2.3