]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_xline/cmd_kline.cpp
Rewrite invite system
[user/henk/code/inspircd.git] / src / coremods / core_xline / cmd_kline.cpp
index c6a8c7cad6b46483a5d5603ffe30f0cfaee1847d..50ab883984d98dad2591fba89c634495aa493938 100644 (file)
 
 #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 = "<ident@host> [<duration> :<reason>]"; }
-       /** 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<std::string>& parameters, User *user);
-};
-
+       flags_needed = 'o';
+       Penalty = 0;
+       syntax = "<ident@host> [<duration> :<reason>]";
+}
 
 /** Handle /KLINE
  */
@@ -63,7 +55,8 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& 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<std::string>& parameters, User
 
        return CMD_SUCCESS;
 }
-
-COMMAND_INIT(CommandKline)