1 |
adx |
30 |
/* |
2 |
michael |
2865 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
adx |
30 |
* |
4 |
michael |
2865 |
* Copyright (c) 1997-2014 ircd-hybrid development team |
5 |
adx |
30 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
19 |
|
|
* USA |
20 |
|
|
*/ |
21 |
|
|
|
22 |
michael |
2865 |
/*! \file channel_mode.h |
23 |
|
|
* \brief Includes channel mode related definitions and structures. |
24 |
|
|
* \version $Id$ |
25 |
|
|
*/ |
26 |
adx |
30 |
|
27 |
|
|
#ifndef INCLUDED_channel_mode_h |
28 |
|
|
#define INCLUDED_channel_mode_h |
29 |
|
|
|
30 |
|
|
#include "ircd_defs.h" /* buffer sizes */ |
31 |
|
|
|
32 |
|
|
#define MODEBUFLEN 200 |
33 |
|
|
|
34 |
|
|
/* Maximum mode changes allowed per client, per server is different */ |
35 |
|
|
#define MAXMODEPARAMS 4 |
36 |
|
|
|
37 |
|
|
/* can_send results */ |
38 |
|
|
#define CAN_SEND_NO 0 |
39 |
michael |
1173 |
#define CAN_SEND_NONOP -1 |
40 |
|
|
#define CAN_SEND_OPV -2 |
41 |
adx |
30 |
|
42 |
|
|
|
43 |
|
|
/* Channel related flags */ |
44 |
|
|
#define CHFL_CHANOP 0x0001 /* Channel operator */ |
45 |
|
|
#define CHFL_HALFOP 0x0002 /* Channel half op */ |
46 |
|
|
#define CHFL_VOICE 0x0004 /* the power to speak */ |
47 |
|
|
#define CHFL_DEOPPED 0x0008 /* deopped by us, modes need to be bounced */ |
48 |
|
|
#define CHFL_BAN 0x0010 /* ban channel flag */ |
49 |
|
|
#define CHFL_EXCEPTION 0x0020 /* exception to ban channel flag */ |
50 |
|
|
#define CHFL_INVEX 0x0040 |
51 |
|
|
|
52 |
|
|
/* channel modes ONLY */ |
53 |
|
|
#define MODE_PRIVATE 0x0001 |
54 |
|
|
#define MODE_SECRET 0x0002 |
55 |
|
|
#define MODE_MODERATED 0x0004 |
56 |
|
|
#define MODE_TOPICLIMIT 0x0008 |
57 |
|
|
#define MODE_INVITEONLY 0x0010 |
58 |
|
|
#define MODE_NOPRIVMSGS 0x0020 |
59 |
michael |
1150 |
#define MODE_SSLONLY 0x0040 |
60 |
|
|
#define MODE_OPERONLY 0x0080 |
61 |
michael |
1167 |
#define MODE_REGISTERED 0x0100 /* Channel has been registered with ChanServ */ |
62 |
michael |
1173 |
#define MODE_REGONLY 0x0200 |
63 |
michael |
1937 |
#define MODE_NOCTRL 0x0400 |
64 |
michael |
1954 |
#define MODE_MODREG 0x0800 |
65 |
adx |
30 |
|
66 |
|
|
/* cache flags for silence on ban */ |
67 |
|
|
#define CHFL_BAN_CHECKED 0x0080 |
68 |
|
|
#define CHFL_BAN_SILENCED 0x0100 |
69 |
|
|
|
70 |
|
|
#define MODE_QUERY 0 |
71 |
|
|
#define MODE_ADD 1 |
72 |
|
|
#define MODE_DEL -1 |
73 |
|
|
|
74 |
|
|
#define CHACCESS_NOTONCHAN -1 |
75 |
|
|
#define CHACCESS_PEON 0 |
76 |
|
|
#define CHACCESS_HALFOP 1 |
77 |
|
|
#define CHACCESS_CHANOP 2 |
78 |
|
|
|
79 |
|
|
/* name invisible */ |
80 |
|
|
#define SecretChannel(x) (((x)->mode.mode & MODE_SECRET)) |
81 |
|
|
#define PubChannel(x) (!SecretChannel(x)) |
82 |
|
|
/* knock is forbidden, halfops can't kick/deop other halfops. |
83 |
|
|
* +pi means paranoid and will generate notices on each invite */ |
84 |
|
|
#define PrivateChannel(x) (((x)->mode.mode & MODE_PRIVATE)) |
85 |
|
|
|
86 |
|
|
struct ChModeChange |
87 |
|
|
{ |
88 |
|
|
char letter; |
89 |
|
|
const char *arg; |
90 |
|
|
const char *id; |
91 |
|
|
int dir; |
92 |
michael |
1015 |
unsigned int caps; |
93 |
|
|
unsigned int nocaps; |
94 |
adx |
30 |
int mems; |
95 |
|
|
struct Client *client; |
96 |
|
|
}; |
97 |
|
|
|
98 |
|
|
struct ChCapCombo |
99 |
|
|
{ |
100 |
|
|
int count; |
101 |
michael |
1015 |
unsigned int cap_yes; |
102 |
|
|
unsigned int cap_no; |
103 |
adx |
30 |
}; |
104 |
|
|
|
105 |
michael |
1175 |
struct mode_letter |
106 |
|
|
{ |
107 |
|
|
const unsigned int mode; |
108 |
|
|
const unsigned char letter; |
109 |
|
|
}; |
110 |
|
|
|
111 |
|
|
extern const struct mode_letter chan_modes[]; |
112 |
adx |
30 |
extern int add_id(struct Client *, struct Channel *, char *, int); |
113 |
|
|
extern void set_channel_mode(struct Client *, struct Client *, struct Channel *, |
114 |
|
|
struct Membership *, int, char **, char *); |
115 |
|
|
extern void clear_ban_cache(struct Channel *); |
116 |
michael |
759 |
extern void clear_ban_cache_client(struct Client *); |
117 |
adx |
30 |
extern void init_chcap_usage_counts(void); |
118 |
|
|
extern void set_chcap_usage_counts(struct Client *); |
119 |
|
|
extern void unset_chcap_usage_counts(struct Client *); |
120 |
|
|
#endif /* INCLUDED_channel_mode_h */ |