2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2013-2014 Attila Molnar <attilamolnar@hush.com>
6 * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
7 * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
9 * This file is part of InspIRCd. InspIRCd is free software: you can
10 * redistribute it and/or modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation, version 2.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 class CommandModeNotice : public Command
28 CommandModeNotice(Module* parent) : Command(parent,"MODENOTICE",2,2)
30 syntax = "<modeletters> :<message>";
34 CmdResult Handle(User* src, const Params& parameters) CXX11_OVERRIDE
36 std::string msg = "*** From " + src->nick + ": " + parameters[1];
37 int mlen = parameters[0].length();
38 const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
39 for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
42 for (int n = 0; n < mlen; n++)
44 if (!user->IsModeSet(parameters[0][n]))
47 user->WriteNotice(msg);
53 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE
55 return ROUTE_OPT_BCAST;
59 class ModuleModeNotice : public Module
61 CommandModeNotice cmd;
69 Version GetVersion() CXX11_OVERRIDE
71 return Version("Provides the MODENOTICE command", VF_VENDOR);
75 MODULE_INIT(ModuleModeNotice)