2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
6 * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com>
7 * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
8 * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
9 * Copyright (C) 2007-2008 Dennis Friis <peavey@inspircd.org>
10 * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
11 * Copyright (C) 2006, 2010 Craig Edwards <brain@inspircd.org>
13 * This file is part of InspIRCd. InspIRCd is free software: you can
14 * redistribute it and/or modify it under the terms of the GNU General Public
15 * License as published by the Free Software Foundation, version 2.
17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 // Globops and snomask +g module by C.J.Edwards
33 class CommandGlobops : public Command
36 CommandGlobops(Module* Creator) : Command(Creator,"GLOBOPS", 1,1)
39 syntax = ":<message>";
42 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
44 if (parameters[0].empty())
46 user->WriteNumeric(ERR_NOTEXTTOSEND, "No text to send");
50 ServerInstance->SNO->WriteGlobalSno('g', "From " + user->nick + ": " + parameters[0]);
55 class ModuleGlobops : public Module
59 ModuleGlobops() : cmd(this) {}
61 void init() CXX11_OVERRIDE
63 ServerInstance->SNO->EnableSnomask('g',"GLOBOPS");
66 Version GetVersion() CXX11_OVERRIDE
68 return Version("Adds the /GLOBOPS command which allows server operators to send messages to all server operators with the g (globops) snomask.", VF_VENDOR);
72 MODULE_INIT(ModuleGlobops)