X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommands%2Fcmd_qline.cpp;h=762fd53c4ba3f8b647b0a04c0940c5f61ce6c378;hb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;hp=d915115766333fec2a6f8d6a2ed6b3b57d32afca;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp index d91511576..762fd53c4 100644 --- a/src/commands/cmd_qline.cpp +++ b/src/commands/cmd_qline.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -13,14 +13,23 @@ #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 = " [ :]"; } + /** 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& parameters, User *user); +}; + CmdResult CommandQline::Handle (const std::vector& parameters, User *user) { @@ -36,7 +45,7 @@ CmdResult CommandQline::Handle (const std::vector& 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& 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& parameters, User return CMD_SUCCESS; } + +COMMAND_INIT(CommandQline)