]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_gline.cpp
Command result codes. This isnt finished yet, still got to do most of the modules...
[user/henk/code/inspircd.git] / src / cmd_gline.cpp
index d167e698b1e0e35c0e8494ed04beab2e64ad8c11..85fe137b4000933e8448dd8a9d3c9d2a1228d41c 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <string>
-#include <vector>
 #include "configreader.h"
 #include "users.h"
 #include "modules.h"
-#include "commands.h"
 #include "xline.h"
+#include "commands/cmd_gline.h"
 
-#include "commands/cmd_eline.h"
 
 
+extern "C" command_t* init_command(InspIRCd* Instance)
+{
+       return new cmd_gline(Instance);
+}
 
-void cmd_gline::Handle (const char** parameters, int pcnt, userrec *user)
+CmdResult cmd_gline::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 :*** G-Line must contain a username, e.g. *@%s",user->nick,parameters[0]);
-                       return;
+                       return CMD_FAILURE;
                }
 
                ServerInstance->XLines->add_gline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]);
@@ -65,4 +66,7 @@ void cmd_gline::Handle (const char** parameters, int pcnt, userrec *user)
                        user->WriteServ("NOTICE %s :*** G-Line %s not found in list, try /stats g.",user->nick,parameters[0]);
                }
        }
+
+       return CMD_SUCCESS;
 }
+