#include "inspircd.h"
#include "xline.h"
-#include "commands/cmd_kline.h"
-extern "C" DllExport Command* init_command(InspIRCd* Instance)
+/** Handle /KLINE. These command handlers can be reloaded by the core,
+ * and handle basic RFC1459 commands. Commands within modules work
+ * the same way, however, they can be fully unloaded, where these
+ * may not.
+ */
+class CommandKline : public Command
{
- return new CommandKline(Instance);
-}
+ public:
+ /** Constructor for kline.
+ */
+ CommandKline ( Module* parent) : Command(parent,"KLINE",1,3) { flags_needed = 'o'; Penalty = 0; syntax = "<ident@host> [<duration> :<reason>]"; }
+ /** Handle command.
+ * @param parameters The parameters to the comamnd
+ * @param pcnt The number of parameters passed to teh 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);
+};
+
/** Handle /KLINE
*/
}
long duration = ServerInstance->Duration(parameters[1].c_str());
- KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
+ KLine* kl = new KLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
if (ServerInstance->XLines->AddLine(kl,user))
{
if (!duration)
{
if (ServerInstance->XLines->DelLine(target.c_str(),"K",user))
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s Removed K-line on %s.",user->nick.c_str(),target.c_str());
+ ServerInstance->SNO->WriteToSnoMask('x',"%s removed K-line on %s",user->nick.c_str(),target.c_str());
}
else
{
return CMD_SUCCESS;
}
+
+COMMAND_INIT(CommandKline)