]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_wallops.cpp
When silence mask is prefixed by + or -, it should only remove the first character...
[user/henk/code/inspircd.git] / src / coremods / core_wallops.cpp
index 26a00a47daa49de8b6bf9357d11a07a74bf0ae91..15fbb188b511130fbd1e9ce6fe0a619a5ac50427 100644 (file)
@@ -36,7 +36,7 @@ class CommandWallops : public Command
                , protoevprov(parent, name)
        {
                flags_needed = 'o';
-               syntax = "<any-text>";
+               syntax = ":<message>";
        }
 
        /** Handle command.
@@ -54,6 +54,12 @@ class CommandWallops : public Command
 
 CmdResult CommandWallops::Handle(User* user, const Params& parameters)
 {
+       if (parameters[0].empty())
+       {
+               user->WriteNumeric(ERR_NOTEXTTOSEND, "No text to send");
+               return CMD_FAILURE;
+       }
+
        ClientProtocol::Message msg("WALLOPS", user);
        msg.PushParamRef(parameters[0]);
        ClientProtocol::Event wallopsevent(protoevprov, msg);
@@ -69,4 +75,21 @@ CmdResult CommandWallops::Handle(User* user, const Params& parameters)
        return CMD_SUCCESS;
 }
 
-COMMAND_INIT(CommandWallops)
+class CoreModWallops : public Module
+{
+ private:
+       CommandWallops cmd;
+
+ public:
+       CoreModWallops()
+               : cmd(this)
+       {
+       }
+
+       Version GetVersion() CXX11_OVERRIDE
+       {
+               return Version("Provides the WALLOPS command", VF_CORE | VF_VENDOR);
+       }
+};
+
+MODULE_INIT(CoreModWallops)