2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2014-2015 Attila Molnar <attilamolnar@hush.com>
7 * This file is part of InspIRCd. InspIRCd is free software: you can
8 * redistribute it and/or modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation, version 2.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "modules/exemption.h"
29 void ShowTopic(LocalUser* user, Channel* chan);
36 /** Used to indicate who we announce invites to on a channel. */
39 /** Don't send invite announcements. */
42 /** Send invite announcements to all users. */
45 /** Send invite announcements to channel operators and higher. */
48 /** Send invite announcements to channel half-operators (if available) and higher. */
55 class CommandInvite : public Command
57 Invite::APIImpl& invapi;
60 Invite::AnnounceState announceinvites;
62 /** Constructor for invite.
64 CommandInvite(Module* parent, Invite::APIImpl& invapiimpl);
67 * @param parameters The parameters to the command
68 * @param user The user issuing the command
69 * @return A value from CmdResult to indicate command success or failure.
71 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
72 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
77 class CommandJoin : public SplitCommand
80 /** Constructor for join.
82 CommandJoin(Module* parent);
85 * @param parameters The parameters to the command
86 * @param user The user issuing the command
87 * @return A value from CmdResult to indicate command success or failure.
89 CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
94 class CommandTopic : public SplitCommand
96 CheckExemption::EventProvider exemptionprov;
97 ChanModeReference secretmode;
98 ChanModeReference topiclockmode;
101 /** Constructor for topic.
103 CommandTopic(Module* parent);
106 * @param parameters The parameters to the command
107 * @param user The user issuing the command
108 * @return A value from CmdResult to indicate command success or failure.
110 CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
115 class CommandNames : public SplitCommand
118 ChanModeReference secretmode;
119 ChanModeReference privatemode;
120 UserModeReference invisiblemode;
121 Events::ModuleEventProvider namesevprov;
124 /** Constructor for names.
126 CommandNames(Module* parent);
129 * @param parameters The parameters to the command
130 * @param user The user issuing the command
131 * @return A value from CmdResult to indicate command success or failure.
133 CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
135 /** Spool the NAMES list for a given channel to the given user
136 * @param user User to spool the NAMES list to
137 * @param chan Channel whose nicklist to send
138 * @param show_invisible True to show invisible (+i) members to the user, false to omit them from the list
140 void SendNames(LocalUser* user, Channel* chan, bool show_invisible);
145 class CommandKick : public Command
148 /** Constructor for kick.
150 CommandKick(Module* parent);
153 * @param parameters The parameters to the command
154 * @param user The user issuing the command
155 * @return A value from CmdResult to indicate command success or failure.
157 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
158 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
163 class ModeChannelBan : public ListModeBase
166 ModeChannelBan(Module* Creator)
167 : ListModeBase(Creator, "ban", 'b', "End of channel ban list", 367, 368, true)
175 class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
178 static const std::string::size_type maxkeylen;
179 ModeChannelKey(Module* Creator);
180 ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE;
181 void SerializeParam(Channel* chan, const std::string* key, std::string& out) ;
182 ModeAction OnSet(User* source, Channel* chan, std::string& param) CXX11_OVERRIDE;
183 bool IsParameterSecret() CXX11_OVERRIDE;
188 class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
192 ModeChannelLimit(Module* Creator);
193 bool ResolveModeConflict(std::string& their_param, const std::string& our_param, Channel* channel) CXX11_OVERRIDE;
194 void SerializeParam(Channel* chan, intptr_t n, std::string& out);
195 ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE;
200 class ModeChannelOp : public PrefixMode
203 ModeChannelOp(Module* Creator)
204 : PrefixMode(Creator, "op", 'o', OP_VALUE, '@')
206 ranktoset = ranktounset = OP_VALUE;
212 class ModeChannelVoice : public PrefixMode
215 ModeChannelVoice(Module* Creator)
216 : PrefixMode(Creator, "voice", 'v', VOICE_VALUE, '+')
219 ranktoset = ranktounset = HALFOP_VALUE;