]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_censor.cpp
Fix TBAN not working if the banner is owner/protected
[user/henk/code/inspircd.git] / src / modules / m_censor.cpp
index c9a0e497a954814a89b136ca2b71de92b9d9aaf6..6a9f6941f78b841f2dc601bd8658119939f414db 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -26,7 +26,7 @@ typedef std::map<irc::string,irc::string> censor_t;
 class CensorUser : public SimpleUserModeHandler
 {
  public:
-       CensorUser(Module* Creator) : SimpleUserModeHandler(Creator, "censor", 'G') { }
+       CensorUser(Module* Creator) : SimpleUserModeHandler(Creator, "u_censor", 'G') { }
 };
 
 /** Handles channel mode +G
@@ -44,14 +44,15 @@ class ModuleCensor : public Module
        CensorChannel cc;
 
  public:
-       ModuleCensor()
-               : cu(this), cc(this)
+       ModuleCensor() : cu(this), cc(this) { }
+
+       void init()
        {
                /* Read the configuration file on startup.
                 */
                OnRehash(NULL);
-               if (!ServerInstance->Modes->AddMode(&cu) || !ServerInstance->Modes->AddMode(&cc))
-                       throw ModuleException("Could not add new modes!");
+               ServerInstance->Modules->AddService(cu);
+               ServerInstance->Modules->AddService(cc);
                Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice };
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
@@ -127,7 +128,7 @@ class ModuleCensor : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Provides user and channel +G mode",VF_COMMON|VF_VENDOR);
+               return Version("Provides user and channel +G mode",VF_VENDOR);
        }
 
 };