X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_xline%2Fcmd_kline.cpp;h=50ab883984d98dad2591fba89c634495aa493938;hb=30fc51c6ddca487a1b89da9ab0ab59da003aee36;hp=c6a8c7cad6b46483a5d5603ffe30f0cfaee1847d;hpb=c67d3103e9f7397f0ab9631bf07a5e5547deb2c3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_xline/cmd_kline.cpp b/src/coremods/core_xline/cmd_kline.cpp index c6a8c7cad..50ab88398 100644 --- a/src/coremods/core_xline/cmd_kline.cpp +++ b/src/coremods/core_xline/cmd_kline.cpp @@ -20,23 +20,15 @@ #include "inspircd.h" #include "xline.h" +#include "core_xline.h" -/** Handle /KLINE. - */ -class CommandKline : public Command +CommandKline::CommandKline(Module* parent) + : Command(parent, "KLINE", 1, 3) { - 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 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); -}; - + flags_needed = 'o'; + Penalty = 0; + syntax = " [ :]"; +} /** Handle /KLINE */ @@ -63,7 +55,8 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User return CMD_FAILURE; } - if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user)) + InsaneBan::IPHostMatcher matcher; + if (InsaneBan::MatchesEveryone(ih.first+"@"+ih.second, matcher, user, "K", "hostmasks")) return CMD_FAILURE; if (target.find('!') != std::string::npos) @@ -110,5 +103,3 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User return CMD_SUCCESS; } - -COMMAND_INIT(CommandKline)