]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_kline.cpp
Made SANICK not collide the user (theres no need to in the new 1.1 now we have return...
[user/henk/code/inspircd.git] / src / cmd_kline.cpp
index ff180575301d11cb3112c1e16f499f99856d5200..a72ea085d549e1a66793d4a5b81dcbc76230cf5b 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <time.h>
-#include <string>
-#include <map>
-#include <sstream>
-#include <vector>
-#include <deque>
-
-#include "inspircd_config.h"
 #include "configreader.h"
-#include "hash_map.h"
 #include "users.h"
 #include "modules.h"
-#include "commands.h"
 #include "xline.h"
-
 #include "commands/cmd_kline.h"
 
-void cmd_kline::Handle (const char** parameters, int pcnt, userrec *user)
+
+
+extern "C" command_t* init_command(InspIRCd* Instance)
+{
+       return new cmd_kline(Instance);
+}
+
+CmdResult cmd_kline::Handle (const char** parameters, int pcnt, userrec *user)
 {
        if (pcnt >= 3)
        {
                if (ServerInstance->HostMatchesEveryone(parameters[0],user))
-                       return;
+                       return CMD_FAILURE;
 
                if (!strchr(parameters[0],'@'))
                {       
                        user->WriteServ("NOTICE %s :*** K-Line must contain a username, e.g. *@%s",user->nick,parameters[0]);
-                       return;
+                       return CMD_FAILURE;
                }
 
                ServerInstance->XLines->add_kline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]);
@@ -70,5 +66,7 @@ void cmd_kline::Handle (const char** parameters, int pcnt, userrec *user)
                        user->WriteServ("NOTICE %s :*** K-Line %s not found in list, try /stats k.",user->nick,parameters[0]);
                }
        }
+
+       return CMD_SUCCESS;
 }