summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-11 17:25:49 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-11 17:25:49 +0000
commit30b7ea53bde0962132314775c939a5eac0a8922e (patch)
tree555d443891464d01c6a7ab1c9f743d8e5b54c6b0
parent9e8368cd8be5b6174a298124b40d47b70ce6d6c6 (diff)
Remove duplication of conf loading code here. Just call rehash in constructor quietly, like normal.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6972 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_operjoin.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 518eeb009..c733bd3a1 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -22,9 +22,7 @@ class ModuleOperjoin : public Module
{
private:
std::string operChan;
- std::vector<std::string> operChans;
- ConfigReader* conf;
-
+ std::vector<std::string> operChans;
int tokenize(const string &str, std::vector<std::string> &tokens)
{
@@ -46,15 +44,9 @@ class ModuleOperjoin : public Module
}
public:
- ModuleOperjoin(InspIRCd* Me)
- : Module::Module(Me)
+ ModuleOperjoin(InspIRCd* Me) : Module::Module(Me)
{
-
- conf = new ConfigReader(ServerInstance);
- operChan = conf->ReadValue("operjoin", "channel", 0);
- operChans.clear();
- if (!operChan.empty())
- tokenize(operChan,operChans);
+ OnRehash(NULL, "");
}
void Implements(char* List)
@@ -64,17 +56,18 @@ class ModuleOperjoin : public Module
virtual void OnRehash(userrec* user, const std::string &parameter)
{
- DELETE(conf);
- conf = new ConfigReader(ServerInstance);
+ ConfigReader* conf = new ConfigReader(ServerInstance);
+
operChan = conf->ReadValue("operjoin", "channel", 0);
operChans.clear();
if (!operChan.empty())
tokenize(operChan,operChans);
+
+ DELETE(conf);
}
virtual ~ModuleOperjoin()
{
- DELETE(conf);
}
virtual Version GetVersion()