From d248ac1a94664492c55dd9086888faf289db7d55 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 1 Nov 2006 08:13:17 +0000 Subject: Remove directive, we've had for years now, make use of it. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5617 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_censor.cpp | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 8f17e0838..5cdee215d 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -27,17 +27,6 @@ typedef std::map censor_t; /* $ModDesc: Provides user and channel +G mode */ -/** Thrown by m_censor - */ -class CensorException : public ModuleException -{ - public: - virtual const char* GetReason() - { - return "Could not find definition in your config file!"; - } -}; - /** Handles usermode +G */ class CensorUser : public ModeHandler @@ -114,19 +103,8 @@ class ModuleCensor : public Module ModuleCensor(InspIRCd* Me) : Module::Module(Me) { - /* - * read the configuration file on startup. - * it is perfectly valid to set to the value of the - * main config file, then append your tags to the bottom - * of the main config... but rather messy. That's why the capability - * of using a seperate config file is provided. - * - * XXX - Really, it'd be nice to scraip this kind of thing, and have something like - * an include directive to include additional configuration files. Might make our lives easier. --w00t - * - * XXX - These module pre-date the include directive which exists since beta 5 -- Brain + /* Read the configuration file on startup. */ - OnRehash(""); cu = new CensorUser(ServerInstance); cc = new CensorChannel(ServerInstance); @@ -201,15 +179,7 @@ class ModuleCensor : public Module * reload our config file on rehash - we must destroy and re-allocate the classes * to call the constructor again and re-read our data. */ - ConfigReader* Conf = new ConfigReader(ServerInstance); - std::string Censorfile = Conf->ReadValue("censor","file",0); - // this automatically re-reads the configuration file into the class - ConfigReader* MyConf = new ConfigReader(ServerInstance, Censorfile); - if ((Censorfile == "") || (!MyConf->Verify())) - { - CensorException e; - throw(e); - } + ConfigReader* MyConf = new ConfigReader(ServerInstance); censors.clear(); for (int index = 0; index < MyConf->Enumerate("badword"); index++) { @@ -217,7 +187,6 @@ class ModuleCensor : public Module irc::string replace = (MyConf->ReadValue("badword","replace",index)).c_str(); censors[pattern] = replace; } - DELETE(Conf); DELETE(MyConf); } -- cgit v1.2.3