]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockcolor.cpp
Add "created" parameter to OnUserJoin, to avoid explicit checks for +P
[user/henk/code/inspircd.git] / src / modules / m_blockcolor.cpp
index 65ef0e82546659cc5ce1e7740028dcaf7eca04ea..020627d01a280f5900f4a7441127faabf1741e68 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -26,13 +26,12 @@ class BlockColor : public SimpleChannelModeHandler
 class ModuleBlockColour : public Module
 {
        bool AllowChanOps;
-       BlockColor *bc;
+       BlockColor bc;
  public:
 
-       ModuleBlockColour(InspIRCd* Me) : Module(Me)
+       ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me)
        {
-               bc = new BlockColor(ServerInstance);
-               if (!ServerInstance->Modes->AddMode(bc))
+               if (!ServerInstance->Modes->AddMode(&bc))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -83,8 +82,7 @@ class ModuleBlockColour : public Module
 
        virtual ~ModuleBlockColour()
        {
-               ServerInstance->Modes->DelMode(bc);
-               delete bc;
+               ServerInstance->Modes->DelMode(&bc);
        }
 
        virtual Version GetVersion()