]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_knock.cpp
Remove useless vector copy
[user/henk/code/inspircd.git] / src / modules / m_knock.cpp
index 12dc1c79694b8c876eb5ad22ee4dd038cf544ce4..45b213b40decbcb66316df819d7fa308a46a5de4 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -26,7 +26,7 @@ class CommandKnock : public Command
                syntax = "<channel> <reason>";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
-       
+
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
                Channel* c = ServerInstance->FindChan(parameters[0]);
@@ -78,31 +78,26 @@ class Knock : public SimpleChannelModeHandler
 
 class ModuleKnock : public Module
 {
-       CommandKnock* mycommand;
-       Knock* kn;
+       CommandKnock cmd;
+       Knock kn;
  public:
-       ModuleKnock(InspIRCd* Me) : Module(Me)
+       ModuleKnock(InspIRCd* Me) : Module(Me), cmd(Me), kn(Me)
        {
-               kn = new Knock(ServerInstance);
-
-               if (!ServerInstance->Modes->AddMode(kn))
+               if (!ServerInstance->Modes->AddMode(&kn))
                        throw ModuleException("Could not add new modes!");
-
-               mycommand = new CommandKnock(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
+               ServerInstance->AddCommand(&cmd);
 
        }
 
 
        virtual ~ModuleKnock()
        {
-               ServerInstance->Modes->DelMode(kn);
-               delete kn;
+               ServerInstance->Modes->DelMode(&kn);
        }
 
        virtual Version GetVersion()
        {
-               return Version(1, 2, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };