* +------------------------------------+
*
* 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.
#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)
{
}
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)
{
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
{
return CMD_SUCCESS;
}
+
+COMMAND_INIT(CommandQline)