]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_remove.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_remove.cpp
index 23fee34c3267dc82155aecfa8db84b4c81c2f053..feb2afa85c337cc0ad57a6aa12dabb4bacaa9ddc 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <sstream>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "configreader.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides a /remove command, this is mostly an alternative to /kick, except makes users appear to have parted the channel */
@@ -201,6 +196,7 @@ class RemoveBase
                        return CMD_FAILURE;
                }
 
+               /* route me */
                return CMD_SUCCESS;
        }
 };
@@ -214,6 +210,7 @@ class cmd_remove : public command_t, public RemoveBase
        {
                this->source = "m_remove.so";
                syntax = "<nick> <channel> [<reason>]";
+               TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END);
        }
        
        CmdResult Handle (const char** parameters, int pcnt, userrec *user)
@@ -248,7 +245,7 @@ class ModuleRemove : public Module
        
  public:
        ModuleRemove(InspIRCd* Me)
-       : Module::Module(Me)
+       : Module(Me)
        {
                mycommand = new cmd_remove(ServerInstance, supportnokicks);
                mycommand2 = new cmd_fpart(ServerInstance, supportnokicks);
@@ -275,39 +272,13 @@ class ModuleRemove : public Module
        
        virtual ~ModuleRemove()
        {
-               delete mycommand;
-               delete mycommand2;
        }
        
        virtual Version GetVersion()
        {
-               return Version(1,1,1,0,VF_VENDOR,API_VERSION);
+               return Version(1, 1, 1, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
        
 };
 
-// stuff down here is the module-factory stuff. For basic modules you can ignore this.
-
-class ModuleRemoveFactory : public ModuleFactory
-{
- public:
-       ModuleRemoveFactory()
-       {
-       }
-       
-       ~ModuleRemoveFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleRemove(Me);
-       }
-       
-};
-
-
-extern "C" void * init_module( void )
-{
-       return new ModuleRemoveFactory;
-}
+MODULE_INIT(ModuleRemove)