]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_zline.cpp
Jesus, look who's the commit whore today. More header updates, and removal of namespa...
[user/henk/code/inspircd.git] / src / cmd_zline.cpp
index 0a87a030b9df559e3f238a4737c7dfc9aabde7fa..c0ddf0db69b54ec69fd51574c8fb2efb7f294778 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
  *
- * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
 #include "xline.h"
 #include "commands/cmd_zline.h"
 
-void cmd_zline::Handle (const char** parameters, int pcnt, userrec *user)
+
+
+extern "C" command_t* init_command(InspIRCd* Instance)
+{
+       return new cmd_zline(Instance);
+}
+
+CmdResult cmd_zline::Handle (const char** parameters, int pcnt, userrec *user)
 {
        if (pcnt >= 3)
        {
                if (strchr(parameters[0],'@'))
                {
                        user->WriteServ("NOTICE %s :*** You cannot include a username in a zline, a zline must ban only an IP mask",user->nick);
-                       return;
+                       return CMD_FAILURE;
                }
+
                if (ServerInstance->IPMatchesEveryone(parameters[0],user))
-                       return;
+                       return CMD_FAILURE;
+
                ServerInstance->XLines->add_zline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]);
                FOREACH_MOD(I_OnAddZLine,OnAddZLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0]));
                if (!ServerInstance->Duration(parameters[1]))
@@ -54,6 +60,9 @@ void cmd_zline::Handle (const char** parameters, int pcnt, userrec *user)
                else
                {
                        user->WriteServ("NOTICE %s :*** Z-Line %s not found in list, try /stats Z.",user->nick,parameters[0]);
+                       return CMD_FAILURE;
                }
        }
+
+       return CMD_SUCCESS;
 }