]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_qline.cpp
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / src / commands / cmd_qline.cpp
index 43d389804da080276a6e4f92c5763d82effc96dc..762fd53c4ba3f8b647b0a04c0940c5f61ce6c378 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
 
 #include "inspircd.h"
 #include "xline.h"
-#include "commands/cmd_qline.h"
 
-
-
-extern "C" DllExport Command* init_command(InspIRCd* Instance)
+/** Handle /QLINE.  */
+class CommandQline : public Command
 {
-       return new CommandQline(Instance);
-}
+ public:
+       /** Constructor for qline.
+        */
+       CommandQline ( Module* parent) : Command(parent,"QLINE",1,3) { flags_needed = 'o'; Penalty = 0; syntax = "<nick> [<duration> :<reason>]"; }
+       /** Handle command.
+        * @param parameters The parameters to the comamnd
+        * @param pcnt The number of parameters passed to the command
+        * @param user The user issuing the command
+        * @return A value from CmdResult to indicate command success or failure.
+        */
+       CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+};
+
 
 CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User *user)
 {
@@ -36,7 +45,7 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User
                }
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
-               QLine* ql = new QLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+               QLine* ql = new QLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
                if (ServerInstance->XLines->AddLine(ql,user))
                {
                        if (!duration)
@@ -61,7 +70,7 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User
        {
                if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "Q", user))
                {
-                       ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Q-line on %s.",user->nick.c_str(),parameters[0].c_str());
+                       ServerInstance->SNO->WriteToSnoMask('x',"%s removed Q-line on %s",user->nick.c_str(),parameters[0].c_str());
                }
                else
                {
@@ -73,3 +82,5 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User
        return CMD_SUCCESS;
 }
 
+
+COMMAND_INIT(CommandQline)