]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_xline/cmd_gline.cpp
Add User::WriteRemoteNumeric() and switch code using SendText() to send numerics...
[user/henk/code/inspircd.git] / src / coremods / core_xline / cmd_gline.cpp
index 18a661b24ec3f7569a9b327a8743fda8ffd1ec79..3f042c3669de0d8292740a22709971c25d881580 100644 (file)
 
 #include "inspircd.h"
 #include "xline.h"
+#include "core_xline.h"
 
-/** Handle /GLINE.
- */
-class CommandGline : public Command
+CommandGline::CommandGline(Module* parent)
+       : Command(parent, "GLINE", 1, 3)
 {
- public:
-       /** Constructor for gline.
-        */
-       CommandGline (Module* parent) : Command(parent,"GLINE",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 /GLINE
  */
@@ -63,7 +55,8 @@ CmdResult CommandGline::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, "G", "hostmasks"))
                        return CMD_FAILURE;
 
                else if (target.find('!') != std::string::npos)
@@ -111,5 +104,3 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User
 
        return CMD_SUCCESS;
 }
-
-COMMAND_INIT(CommandGline)