]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dccallow.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_dccallow.cpp
index 367a3769ebefe59697cf536d9f08058900c42b0c..fd51e4d61767b1ee066698dc1b83b4fc95869680 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <stdio.h>
-#include <vector>
-#include <string.h>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* $ModDesc: Povides support for the /DCCALLOW command */
@@ -57,6 +51,7 @@ class cmd_dccallow : public command_t
        {
                this->source = "m_dccallow.so";
                syntax = "{[+|-]<nick> <time>|HELP|LIST}";
+               /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */
        }
 
        CmdResult Handle(const char **parameters, int pcnt, userrec *user)
@@ -164,7 +159,7 @@ class cmd_dccallow : public command_t
                                        long length;
                                        if (pcnt < 2)
                                        {
-                                               length = ServerInstance->Duration(default_length.c_str());
+                                               length = ServerInstance->Duration(default_length);
                                        } 
                                        else if (!atoi(parameters[1]))
                                        {
@@ -485,29 +480,8 @@ class ModuleDCCAllow : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };
 
-class ModuleDCCAllowFactory : public ModuleFactory
-{
- public:
-       ModuleDCCAllowFactory()
-       {
-       }
-
-       ~ModuleDCCAllowFactory()
-       {
-       }
-
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleDCCAllow(Me);
-       }
-
-};
-
-extern "C" DllExport void * init_module( void )
-{
-       return new ModuleDCCAllowFactory;
-}
+MODULE_INIT(ModuleDCCAllow)