]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_censor.cpp
Mode +b stuff, probably wont work yet
[user/henk/code/inspircd.git] / src / modules / m_censor.cpp
index d42e8b3243892d1c76296af1521c65d4f43895ad..6a5acb54cb275db09c6a197bbaefb05e75289b13 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
+ *                                    E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
  *     
@@ -30,7 +30,7 @@ typedef std::map<irc::string,irc::string> censor_t;
 class CensorException : public ModuleException
 {
  public:
-       virtual char* GetReason()
+       virtual const char* GetReason()
        {
                return "Could not find <censor file=\"\"> definition in your config file!";
        }
@@ -70,10 +70,10 @@ class ModuleCensor : public Module
        }
 
 
-        virtual void On005Numeric(std::string &output)
-        {
+       virtual void On005Numeric(std::string &output)
+       {
                InsertMode(output,"G",4);
-        }
+       }
 
 
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
@@ -124,7 +124,7 @@ class ModuleCensor : public Module
                                else if (target_type == TYPE_CHANNEL)
                                {
                                        chanrec* t = (chanrec*)dest;
-                                       active = (t->IsCustomModeSet('G'));
+                                       active = (t->IsModeSet('G'));
                                }
                                
                                if (active)
@@ -158,14 +158,14 @@ class ModuleCensor : public Module
                        throw(e);
                }
                censors.clear();
-                for (int index = 0; index < MyConf->Enumerate("badword"); index++)
-                {
-                        irc::string pattern = (MyConf->ReadValue("badword","text",index)).c_str();
-                        irc::string replace = (MyConf->ReadValue("badword","replace",index)).c_str();
+               for (int index = 0; index < MyConf->Enumerate("badword"); index++)
+               {
+                       irc::string pattern = (MyConf->ReadValue("badword","text",index)).c_str();
+                       irc::string replace = (MyConf->ReadValue("badword","replace",index)).c_str();
                        censors[pattern] = replace;
                }
-               delete Conf;
-               delete MyConf;
+               DELETE(Conf);
+               DELETE(MyConf);
        }
        
        virtual Version GetVersion()