From 9d4004e8d477232c143830508a7a6e41fd2d31b7 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 2 Feb 2010 19:03:07 +0000 Subject: Allow opermotd to specify its file in without also requiring an block git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12355 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_opermotd.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/modules/m_opermotd.cpp') diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index be832e289..7b4584db9 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -63,12 +63,9 @@ class ModuleOpermotd : public Module void LoadOperMOTD() { - ConfigReader conf; - std::string filename; - filename = conf.ReadValue("opermotd","file",0); - delete opermotd; - opermotd = new FileReader(filename); - onoper = conf.ReadFlag("opermotd","onoper","yes",0); + ConfigTag* conf = ServerInstance->Config->ConfValue("opermotd"); + opermotd->LoadFile(conf->getString("file","opermotd")); + onoper = conf->getBool("onoper", true); } ModuleOpermotd() @@ -84,6 +81,8 @@ class ModuleOpermotd : public Module virtual ~ModuleOpermotd() { + delete opermotd; + opermotd = NULL; } virtual Version GetVersion() @@ -91,7 +90,6 @@ class ModuleOpermotd : public Module return Version("Shows a message to opers after oper-up, adds /opermotd", VF_VENDOR); } - virtual void OnOper(User* user, const std::string &opertype) { if (onoper) -- cgit v1.2.3