From 30b7ea53bde0962132314775c939a5eac0a8922e Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 11 May 2007 17:25:49 +0000 Subject: 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 --- src/modules/m_operjoin.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/modules/m_operjoin.cpp') 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 operChans; - ConfigReader* conf; - + std::vector operChans; int tokenize(const string &str, std::vector &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 ¶meter) { - 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() -- cgit v1.2.3