diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-01 08:13:17 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-01 08:13:17 +0000 |
commit | d248ac1a94664492c55dd9086888faf289db7d55 (patch) | |
tree | 6bd7402b5e1bc32975c15861b84896fe8addbf3b | |
parent | bbecfb8b37b99505cb62bad6f659144ac00f7125 (diff) |
Remove <censor file> directive, we've had <include> for years now, make use of it.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5617 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | docs/inspircd.conf.example | 12 | ||||
-rw-r--r-- | src/modules/m_censor.cpp | 35 |
2 files changed, 9 insertions, 38 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index 9a05f43db..b7d62086c 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -866,11 +866,11 @@ # #-#-#-#-#-#-#-#-#-#-#- CENSOR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # -# Optional - If you specify to use the m_censor module, then specfiy # -# below the path to the censor.conf file. See also: # -# Censor file, see http://www.inspircd.org/wiki/Censor_Module # +# Optional - If you specify to use the m_censor module, then you must # +# specify some censor tags. See also: # +# http://www.inspircd.org/wiki/Censor_Module # # -#<censor file="/path/to/censor.conf"> +#<include file="censor.conf"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Channel filter module: Allows channel-op defined message @@ -1011,8 +1011,10 @@ #-#-#-#-#-#-#-#-#-#-#- FILTER CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # Optional - If you specify to use the m_filter or m_filter_pcre # -# modules, then specfiy below the path to the filter.conf file. # +# modules, then specfiy below the path to the filter.conf file, # +# or define some <filter> tags. # # # +#<include file="filter.conf"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Foobar module: does nothing - historical relic 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<irc::string,irc::string> 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 <censor file=\"\"> 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 <censor file> to the value of the - * main config file, then append your <badword> 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); } |