]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_stripcolor.cpp
Replace std::deque with std::vector in spanningtree and related modules
[user/henk/code/inspircd.git] / src / modules / m_stripcolor.cpp
index 605068d4601eeddfd1fde9fa8c82b8a356bdd1d7..4c5e7c0282641cc018b2176746dcfe0b60ee1774 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.
@@ -35,16 +35,13 @@ class UserStripColor : public SimpleUserModeHandler
 class ModuleStripColor : public Module
 {
        bool AllowChanOps;
-       ChannelStripColor *csc;
-       UserStripColor *usc;
+       ChannelStripColor csc;
+       UserStripColor usc;
 
  public:
-       ModuleStripColor(InspIRCd* Me) : Module(Me)
+       ModuleStripColor(InspIRCd* Me) : Module(Me), csc(Me), usc(Me)
        {
-               usc = new UserStripColor(ServerInstance);
-               csc = new ChannelStripColor(ServerInstance);
-
-               if (!ServerInstance->Modes->AddMode(usc) || !ServerInstance->Modes->AddMode(csc))
+               if (!ServerInstance->Modes->AddMode(&usc) || !ServerInstance->Modes->AddMode(&csc))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -52,10 +49,8 @@ class ModuleStripColor : public Module
 
        virtual ~ModuleStripColor()
        {
-               ServerInstance->Modes->DelMode(usc);
-               ServerInstance->Modes->DelMode(csc);
-               delete usc;
-               delete csc;
+               ServerInstance->Modes->DelMode(&usc);
+               ServerInstance->Modes->DelMode(&csc);
        }
 
        virtual void On005Numeric(std::string &output)