2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5 * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
6 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7 * Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
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/>.
27 #include "modules/exemption.h"
31 void ShowTopic(LocalUser* user, Channel* chan);
41 class CommandInvite : public Command
43 Invite::APIImpl& invapi;
46 /** Constructor for invite.
48 CommandInvite(Module* parent, Invite::APIImpl& invapiimpl);
51 * @param parameters The parameters to the command
52 * @param user The user issuing the command
53 * @return A value from CmdResult to indicate command success or failure.
55 CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
56 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE;
61 class CommandJoin : public SplitCommand
64 /** Constructor for join.
66 CommandJoin(Module* parent);
69 * @param parameters The parameters to the command
70 * @param user The user issuing the command
71 * @return A value from CmdResult to indicate command success or failure.
73 CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
78 class CommandTopic : public SplitCommand
80 CheckExemption::EventProvider exemptionprov;
81 ChanModeReference secretmode;
82 ChanModeReference topiclockmode;
85 /** Constructor for topic.
87 CommandTopic(Module* parent);
90 * @param parameters The parameters to the command
91 * @param user The user issuing the command
92 * @return A value from CmdResult to indicate command success or failure.
94 CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
99 class CommandNames : public SplitCommand
101 ChanModeReference secretmode;
102 ChanModeReference privatemode;
103 UserModeReference invisiblemode;
106 /** Constructor for names.
108 CommandNames(Module* parent);
111 * @param parameters The parameters to the command
112 * @param user The user issuing the command
113 * @return A value from CmdResult to indicate command success or failure.
115 CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
117 /** Spool the NAMES list for a given channel to the given user
118 * @param user User to spool the NAMES list to
119 * @param chan Channel whose nicklist to send
120 * @param show_invisible True to show invisible (+i) members to the user, false to omit them from the list
122 void SendNames(LocalUser* user, Channel* chan, bool show_invisible);
127 class CommandKick : public Command
130 /** Constructor for kick.
132 CommandKick(Module* parent);
135 * @param parameters The parameters to the command
136 * @param user The user issuing the command
137 * @return A value from CmdResult to indicate command success or failure.
139 CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
140 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE;
145 class ModeChannelBan : public ListModeBase
148 ModeChannelBan(Module* Creator)
149 : ListModeBase(Creator, "ban", 'b', "End of channel ban list", 367, 368, true, "maxbans")
156 class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
158 static const std::string::size_type maxkeylen = 32;
160 ModeChannelKey(Module* Creator);
161 ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE;
162 void SerializeParam(Channel* chan, const std::string* key, std::string& out) ;
163 ModeAction OnSet(User* source, Channel* chan, std::string& param) CXX11_OVERRIDE;
168 class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
171 ModeChannelLimit(Module* Creator);
172 bool ResolveModeConflict(std::string& their_param, const std::string& our_param, Channel* channel) CXX11_OVERRIDE;
173 void SerializeParam(Channel* chan, intptr_t n, std::string& out);
174 ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE;
179 class ModeChannelOp : public PrefixMode
182 ModeChannelOp(Module* Creator)
183 : PrefixMode(Creator, "op", 'o', OP_VALUE, '@')
185 ranktoset = ranktounset = OP_VALUE;
191 class ModeChannelVoice : public PrefixMode
194 ModeChannelVoice(Module* Creator)
195 : PrefixMode(Creator, "voice", 'v', VOICE_VALUE, '+')
198 ranktoset = ranktounset = HALFOP_VALUE;