/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013-2014, 2018 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
- * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+ * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ * Copyright (C) 2006, 2010 Craig Edwards <brain@inspircd.org>
*
* 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
, protoevprov(parent, name)
{
flags_needed = 'o';
- syntax = "<any-text>";
+ syntax = ":<message>";
}
/** Handle 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);
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)