]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_close.cpp
Replace OnAccessCheck with OnPreMode to remove a number of redundant checks
[user/henk/code/inspircd.git] / src / modules / m_close.cpp
index 8c8fa92f554d0b280bccdc886b7c6c26720d06b3..1da88c3d5f3dca75ad81a4f43b131c07161e5d00 100644 (file)
@@ -29,9 +29,8 @@ class CommandClose : public Command
 {
  public:
        /* Command 'close', needs operator */
-       CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", "o", 0)
+       CommandClose (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CLOSE", "o", 0)
        {
-               this->source = "m_close.so";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -59,21 +58,18 @@ class CommandClose : public Command
                else
                        user->WriteServ("NOTICE %s :*** No unknown connections found",user->nick.c_str());
 
-               return CMD_LOCALONLY;
+               return CMD_SUCCESS;
        }
 };
 
 class ModuleClose : public Module
 {
-       CommandClose* newcommand;
+       CommandClose cmd;
  public:
        ModuleClose(InspIRCd* Me)
-               : Module(Me)
+               : Module(Me), cmd(Me, this)
        {
-               // Create a new command
-               newcommand = new CommandClose(ServerInstance);
-               ServerInstance->AddCommand(newcommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleClose()