X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_kline.cpp;h=9184a3505e42acbfef188b006a27a1582cb19b3d;hb=9aa6c07d92fb9c1132f06b8c5781d77ee7086edb;hp=0a3e7c9303ed3d423d755939391e3cb3914f323f;hpb=b6dbd6caab62bc2c0d11ce5a45d511611eb9c2ef;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index 0a3e7c930..9184a3505 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -13,12 +13,27 @@ #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 = " [ :]"; } + /** 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& parameters, User *user); +}; + /** Handle /KLINE */ @@ -55,7 +70,7 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User } 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) @@ -81,7 +96,7 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User { 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 { @@ -91,3 +106,5 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User return CMD_SUCCESS; } + +COMMAND_INIT(CommandKline)