]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_knock.cpp
Fix for bug #415, affects only trunk (wish i'd known this before i started!)
[user/henk/code/inspircd.git] / src / modules / m_knock.cpp
index 3bc45cceb20c8f67f67c8e31686d88d84c24dd7a..5ed69273e2d4e82e42a69c5cd92e6585f324a626 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides support for /KNOCK and mode +K */
 
@@ -27,6 +24,7 @@ class cmd_knock : public command_t
        {
                this->source = "m_knock.so";
                syntax = "<channel> <reason>";
+               TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
        
        CmdResult Handle (const char** parameters, int pcnt, userrec *user)
@@ -102,10 +100,11 @@ class ModuleKnock : public Module
  public:
        ModuleKnock(InspIRCd* Me) : Module(Me)
        {
-               
                kn = new Knock(ServerInstance);
+
                if (!ServerInstance->AddMode(kn, 'K'))
                        throw ModuleException("Could not add new modes!");
+
                mycommand = new cmd_knock(ServerInstance);
                ServerInstance->AddCommand(mycommand);
        }
@@ -117,12 +116,12 @@ class ModuleKnock : public Module
        virtual ~ModuleKnock()
        {
                ServerInstance->Modes->DelMode(kn);
-               DELETE(kn);
+               delete kn;
        }
 
        virtual Version GetVersion()
        {
-               return Version(1,1,0,1,VF_COMMON|VF_VENDOR,API_VERSION);
+               return Version(1, 1, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };