summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorfrostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-25 05:54:59 +0000
committerfrostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-25 05:54:59 +0000
commitd70ae11ab22d10e40cae525ff28022e596a7c6f0 (patch)
tree5e6e4f78c876ef656888e15a7f1791613d6e8a6b /src/modules
parentebd92418f89acb456207a05420b71a6f0f27c3f4 (diff)
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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_helpop.cpp48
1 files 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();
}