InspIRCd  3.0
builtinmodes.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2008 Robin Burchell <[email protected]>
5  * Copyright (C) 2007 Dennis Friis <[email protected]>
6  * Copyright (C) 2006 Craig Edwards <[email protected]>
7  *
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.
11  *
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
15  * details.
16  *
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/>.
19  */
20 
21 #pragma once
22 
23 #include "mode.h"
24 #include "channels.h"
25 #include "listmode.h"
26 
30 {
31  public:
33  : ListModeBase(NULL, "ban", 'b', "End of channel ban list", 367, 368, true, "maxbans")
34  {
35  }
36 };
37 
40 class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
41 {
42  static const std::string::size_type maxkeylen = 32;
43  public:
45  ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
46  void SerializeParam(Channel* chan, const std::string* key, std::string& out);
47  ModeAction OnSet(User* source, Channel* chan, std::string& param);
48 };
49 
52 class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
53 {
54  public:
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);
59 };
60 
63 class ModeChannelOp : public PrefixMode
64 {
65  public:
67  : PrefixMode(NULL, "op", 'o', OP_VALUE, '@')
68  {
69  levelrequired = OP_VALUE;
70  }
71 };
72 
76 {
77  public:
79  : PrefixMode(NULL, "voice", 'v', VOICE_VALUE, '+')
80  {
81  levelrequired = HALFOP_VALUE;
82  }
83 };
84 
88 {
96  std::string ProcessNoticeMasks(User* user, const std::string& input);
97 
98  public:
100  ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding) CXX11_OVERRIDE;
101  void OnParameterMissing(User* user, User* dest, Channel* channel) CXX11_OVERRIDE;
102 
107  std::string GetUserParameter(const User* user) const CXX11_OVERRIDE;
108 };
109 
113 {
114  public:
116  ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
117 };
Definition: mode.h:95
Definition: builtinmodes.h:52
virtual void OnParameterMissing(User *user, User *dest, Channel *channel)
Definition: mode.cpp:84
Definition: users.h:224
Definition: builtinmodes.h:63
Definition: builtinmodes.h:29
Definition: builtinmodes.h:75
virtual bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel *channel)
Definition: mode.cpp:88
Definition: builtinmodes.h:112
Definition: builtinmodes.h:40
int levelrequired
Definition: mode.h:154
ListModeBase(Module *Creator, const std::string &Name, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag="banlist")
Definition: listmode.cpp:22
Definition: mode.h:342
Definition: listmode.h:24
virtual std::string GetUserParameter(const User *user) const
Definition: mode.cpp:61
Definition: parammode.h:46
virtual ModeAction OnModeChange(User *source, User *, Channel *channel, std::string &parameter, bool adding)
Definition: listmode.cpp:135
Definition: builtinmodes.h:87
Definition: channels.h:37