X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_globops.cpp;h=b583e22ffea494af4c94917672b33a8533019263;hb=85182d727c0d549b9cf6659ad36dec70fcf02278;hp=d74534ca1888ab12d1099eef9998e80e14b31640;hpb=fd0fa86da89ab4cefa778307088ef2552a05a170;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index d74534ca1..b583e22ff 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -30,11 +30,17 @@ class CommandGlobops : public Command public: CommandGlobops(Module* Creator) : Command(Creator,"GLOBOPS", 1,1) { - flags_needed = 'o'; syntax = ""; + flags_needed = 'o'; syntax = ":"; } - CmdResult Handle (const std::vector ¶meters, User *user) + 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; } @@ -48,13 +54,12 @@ class ModuleGlobops : public Module void init() CXX11_OVERRIDE { - ServerInstance->Modules->AddService(cmd); ServerInstance->SNO->EnableSnomask('g',"GLOBOPS"); } Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support for GLOBOPS and snomask +g", VF_VENDOR); + return Version("Provides the GLOBOPS command and snomask 'g'", VF_VENDOR); } };