summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-07-15 15:46:06 +0100
committerPeter Powell <petpow@saberuk.com>2019-07-15 15:46:44 +0100
commit5a3627b0a7d650a924da57a939fc50434caeef11 (patch)
tree9a665359cfd48e87f9c7643a8f8d0a754b87390c /src
parent06e2961a86705d794fd5904000e44a7ae08004d9 (diff)
Send ERR_NOTEXTTOSEND in response to an empty GLOBOPS/WALLOPS.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_wallops.cpp6
-rw-r--r--src/modules/m_globops.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp
index 09fafd244..15fbb188b 100644
--- a/src/coremods/core_wallops.cpp
+++ b/src/coremods/core_wallops.cpp
@@ -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);
diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp
index e70645161..b583e22ff 100644
--- a/src/modules/m_globops.cpp
+++ b/src/modules/m_globops.cpp
@@ -35,6 +35,12 @@ class CommandGlobops : public Command
CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
+ if (parameters[0].empty())
+ {
+ user->WriteNumeric(ERR_NOTEXTTOSEND, "No text to send");
+ return CMD_FAILURE;
+ }
+
ServerInstance->SNO->WriteGlobalSno('g', "From " + user->nick + ": " + parameters[0]);
return CMD_SUCCESS;
}