X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_wallops.cpp;h=3855f319d6efcd659e213fe904408e64e72bb94d;hb=7ba36f5348a6cca1c0da820c60ae17063f3cdad5;hp=26a00a47daa49de8b6bf9357d11a07a74bf0ae91;hpb=58a0a7e01422e62de1565a8eb0a1febdc463d04d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp index 26a00a47d..3855f319d 100644 --- a/src/coremods/core_wallops.cpp +++ b/src/coremods/core_wallops.cpp @@ -1,8 +1,13 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018-2019 Sadie Powell + * Copyright (C) 2013-2014, 2018 Attila Molnar + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -36,7 +41,7 @@ class CommandWallops : public Command , protoevprov(parent, name) { flags_needed = 'o'; - syntax = ""; + syntax = ":"; } /** Handle command. @@ -54,6 +59,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 +80,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)