2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
5 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
6 * Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
8 * This file is part of InspIRCd. InspIRCd is free software: you can
9 * redistribute it and/or modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation, version 2.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 class ModeChannelBan : public ListModeBase
33 : ListModeBase(NULL, "ban", 'b', "End of channel ban list", 367, 368, true, "maxbans")
40 class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
42 static const std::string::size_type maxkeylen = 32;
45 ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding);
46 void SerializeParam(Channel* chan, const std::string* key, std::string& out);
47 ModeAction OnSet(User* source, Channel* chan, std::string& param);
52 class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
56 bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);
57 void SerializeParam(Channel* chan, intptr_t n, std::string& out);
58 ModeAction OnSet(User* source, Channel* channel, std::string& parameter);
63 class ModeChannelOp : public PrefixMode
67 : PrefixMode(NULL, "op", 'o', OP_VALUE, '@')
69 ranktoset = ranktounset = OP_VALUE;
75 class ModeChannelVoice : public PrefixMode
79 : PrefixMode(NULL, "voice", 'v', VOICE_VALUE, '+')
82 ranktoset = ranktounset = HALFOP_VALUE;
88 class ModeUserServerNoticeMask : public ModeHandler
90 /** Process a snomask modifier string, e.g. +abc-de
91 * @param user The target user
92 * @param input A sequence of notice mask characters
93 * @return The cleaned mode sequence which can be output,
94 * e.g. in the above example if masks c and e are not
95 * valid, this function will return +ab-d
97 std::string ProcessNoticeMasks(User* user, const std::string& input);
100 ModeUserServerNoticeMask();
101 ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) CXX11_OVERRIDE;
102 void OnParameterMissing(User* user, User* dest, Channel* channel) CXX11_OVERRIDE;
104 /** Create a displayable mode string of the snomasks set on a given user
105 * @param user The user whose notice masks to format
106 * @return The notice mask character sequence
108 std::string GetUserParameter(const User* user) const CXX11_OVERRIDE;
113 class ModeUserOperator : public ModeHandler
117 ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding);