]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_remove.cpp
Fix for bug #415, affects only trunk (wish i'd known this before i started!)
[user/henk/code/inspircd.git] / src / modules / m_remove.cpp
index 714490d8207d62e52c53ddd8c4ccf9c3e5e9f4ec..c8d661890bfb6f5c079265961cb0a91b8f46782c 100644 (file)
  */
 
 #include "inspircd.h"
-#include <sstream>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "configreader.h"
 
 /* $ModDesc: Provides a /remove command, this is mostly an alternative to /kick, except makes users appear to have parted the channel */
 
@@ -154,7 +149,7 @@ class RemoveBase
                        tlevel = chartolevel(channel->GetPrefixChar(target));
                }
                
-               hasnokicks = (ServerInstance->FindModule("m_nokicks.so") && channel->IsModeSet('Q'));
+               hasnokicks = (ServerInstance->Modules->Find("m_nokicks.so") && channel->IsModeSet('Q'));
                
                /* We support the +Q channel mode via. the m_nokicks module, if the module is loaded and the mode is set then disallow the /remove */
                if ((!IS_LOCAL(user)) || (!supportnokicks || !hasnokicks || (ulevel == ULINE)))
@@ -215,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)
@@ -276,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" DllExport void * init_module( void )
-{
-       return new ModuleRemoveFactory;
-}
+MODULE_INIT(ModuleRemove)