summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-01 08:44:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-01 08:44:18 +0000
commit015930fbdb3eed82b44c758a59be7c932cbe5d9d (patch)
tree8f181d945f8d6058cf440f630e4e4eb91b80c643
parentd248ac1a94664492c55dd9086888faf289db7d55 (diff)
Remove <helpop file>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5618 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--docs/inspircd.conf.example5
-rw-r--r--src/modules/m_helpop.cpp35
2 files changed, 14 insertions, 26 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index b7d62086c..95bf80b33 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -1036,9 +1036,10 @@
#-#-#-#-#-#-#-#-#-#-#-#- HELPOP CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#
# #
# Optional - If you specify to use the m_helpop.so module, then #
-# specify below the path to the helpop.conf file. #
+# specify below the path to the helpop.conf file, or if you like to #
+# make a mess, define your helpop tags in this conf. #
# #
-#<helpop file="helpop.conf">
+#<include file="helpop.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# HIDECHANS module: Allows opers to hide their channels list from non-
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index cc82e1218..f5fce322b 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -24,8 +24,8 @@ using namespace std;
// Global Vars
static ConfigReader *helpop;
-bool do_helpop(const char**, int, userrec*);
-void sendtohelpop(userrec*, int, const char**);
+/*bool do_helpop(const char**, int, userrec*);
+void sendtohelpop(userrec*, int, const char**);*/
/* $ModDesc: /helpop Command, Works like Unreal helpop */
@@ -98,7 +98,7 @@ class cmd_helpop : public command_t
for (int i = 1; output != ""; i++)
{
snprintf(a,MAXBUF,"line%d",i);
- output = helpop->ReadValue("nohelp", std::string(a), 0);
+ output = helpop->ReadValue("helpop_nohelp", a, 0);
if(output != "")
{
@@ -117,7 +117,7 @@ class cmd_helpop : public command_t
{
snprintf(a,MAXBUF,"line%d",i);
/* "nohelpo" for opers "nohelp" for users */
- output = helpop->ReadValue("nohelpo", std::string(a), 0);
+ output = helpop->ReadValue("helpop_nohelpo", a, 0);
if (output != "")
{
user->WriteServ("290 "+std::string(user->nick)+" :"+output);
@@ -141,13 +141,14 @@ class cmd_helpop : public command_t
if (!pcnt)
{
- strcpy(search,"start");
+ strcpy(search,"helpop_start");
}
else
{
if (*parameters[0] == '?')
parameters[0]++;
- strlcpy(search,parameters[0],MAXBUF);
+ strlcpy(search, "helpop_", MAXBUF);
+ strlcat(search, parameters[0], MAXBUF);
}
for (char* n = search; *n; n++)
@@ -197,7 +198,6 @@ class HelpopException : public ModuleException
class ModuleHelpop : public Module
{
private:
- ConfigReader *conf;
std::string h_file;
cmd_helpop* mycommand;
Helpop* ho;
@@ -215,20 +215,10 @@ class ModuleHelpop : public Module
virtual void ReadConfig()
{
- conf = new ConfigReader(ServerInstance);
- h_file = conf->ReadValue("helpop", "file", 0);
-
- if (h_file == "")
- {
- helpop = NULL;
- HelpopException e("Missing helpop file");
- throw(e);
- }
-
- helpop = new ConfigReader(ServerInstance, h_file);
- if ((helpop->ReadValue("nohelp", "line1", 0) == "") ||
- (helpop->ReadValue("nohelpo", "line1", 0) == "") ||
- (helpop->ReadValue("start", "line1", 0) == ""))
+ helpop = new ConfigReader(ServerInstance);
+ if ((helpop->ReadValue("helpop_nohelp", "line1", 0) == "") ||
+ (helpop->ReadValue("helpop_nohelpo", "line1", 0) == "") ||
+ (helpop->ReadValue("helpop_start", "line1", 0) == ""))
{
HelpopException e("m_helpop: Helpop file is missing important entries. Please check the example conf.");
throw(e);
@@ -242,10 +232,8 @@ class ModuleHelpop : public Module
virtual void OnRehash(const std::string &parameter)
{
- DELETE(conf);
if (helpop)
DELETE(helpop);
-
ReadConfig();
}
@@ -260,7 +248,6 @@ class ModuleHelpop : public Module
virtual ~ModuleHelpop()
{
ServerInstance->Modes->DelMode(ho);
- DELETE(conf);
DELETE(helpop);
DELETE(ho);
}