| 1 |
|
/* |
| 2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (c) 1997-2014 ircd-hybrid development team |
| 4 |
> |
* Copyright (c) 1997-2015 ircd-hybrid development team |
| 5 |
|
* |
| 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 |
| 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 |
| 18 |
> |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 19 |
|
* USA |
| 20 |
|
*/ |
| 21 |
|
|
| 27 |
|
#ifndef INCLUDED_channel_mode_h |
| 28 |
|
#define INCLUDED_channel_mode_h |
| 29 |
|
|
| 30 |
< |
#define MODEBUFLEN 200 |
| 30 |
> |
|
| 31 |
> |
#define CMEMBER_STATUS_FLAGS "@%+" |
| 32 |
> |
enum { CMEMBER_STATUS_FLAGS_LEN = sizeof(CMEMBER_STATUS_FLAGS) - 1 }; |
| 33 |
> |
|
| 34 |
> |
enum { MODEBUFLEN = 200 }; |
| 35 |
|
|
| 36 |
|
/* Maximum mode changes allowed per client, per server is different */ |
| 37 |
< |
#define MAXMODEPARAMS 4 |
| 37 |
> |
enum { MAXMODEPARAMS = 6 }; |
| 38 |
|
|
| 39 |
|
enum |
| 40 |
|
{ |
| 60 |
|
CAN_SEND_OPV = -2 |
| 61 |
|
}; |
| 62 |
|
|
| 59 |
– |
|
| 63 |
|
/* Channel related flags */ |
| 64 |
< |
#define CHFL_CHANOP 0x0001U /* Channel operator */ |
| 65 |
< |
#define CHFL_HALFOP 0x0002U /* Channel half op */ |
| 66 |
< |
#define CHFL_VOICE 0x0004U /* the power to speak */ |
| 67 |
< |
#define CHFL_BAN 0x0008U /* ban channel flag */ |
| 68 |
< |
#define CHFL_EXCEPTION 0x0010U /* exception to ban channel flag */ |
| 69 |
< |
#define CHFL_INVEX 0x0020U |
| 64 |
> |
enum |
| 65 |
> |
{ |
| 66 |
> |
CHFL_CHANOP = 0x00000001U, /* Channel operator */ |
| 67 |
> |
CHFL_HALFOP = 0x00000002U, /* Channel half op */ |
| 68 |
> |
CHFL_VOICE = 0x00000004U, /* the power to speak */ |
| 69 |
> |
CHFL_BAN = 0x00000008U, /* ban channel flag */ |
| 70 |
> |
CHFL_EXCEPTION = 0x00000010U, /* exception to ban channel flag */ |
| 71 |
> |
CHFL_INVEX = 0x00000020U, |
| 72 |
> |
/* Cache flags for silence on ban */ |
| 73 |
> |
CHFL_BAN_CHECKED = 0x00000040U, |
| 74 |
> |
CHFL_BAN_SILENCED = 0x00000080U |
| 75 |
> |
}; |
| 76 |
|
|
| 77 |
|
/* channel modes ONLY */ |
| 78 |
< |
#define MODE_PRIVATE 0x0001U /**< */ |
| 79 |
< |
#define MODE_SECRET 0x0002U /**< Channel does not show up on NAMES or LIST */ |
| 80 |
< |
#define MODE_MODERATED 0x0004U /**< Users without +v/h/o cannot send text to the channel */ |
| 81 |
< |
#define MODE_TOPICLIMIT 0x0008U /**< Only chanops can change the topic */ |
| 82 |
< |
#define MODE_INVITEONLY 0x0010U /**< Only invited usersmay join this channel */ |
| 83 |
< |
#define MODE_NOPRIVMSGS 0x0020U /**< Users must be in the channel to send text to it */ |
| 84 |
< |
#define MODE_SSLONLY 0x0040U /**< Prevents anyone who isn't connected via SSL/TLS from joining the channel */ |
| 85 |
< |
#define MODE_OPERONLY 0x0080U /**< Prevents anyone who hasn't obtained IRC operator status from joining the channel */ |
| 86 |
< |
#define MODE_REGISTERED 0x0100U /**< Channel has been registered with ChanServ */ |
| 87 |
< |
#define MODE_REGONLY 0x0200U /**< Only registered clients may join a channel with that mode set */ |
| 88 |
< |
#define MODE_NOCTRL 0x0400U /**< Prevents users from sending messages containing control codes to the channel */ |
| 89 |
< |
#define MODE_MODREG 0x0800U /**< Unregistered/unidentified clients cannot send text to the channel */ |
| 90 |
< |
|
| 91 |
< |
/* cache flags for silence on ban */ |
| 92 |
< |
#define CHFL_BAN_CHECKED 0x0080U |
| 93 |
< |
#define CHFL_BAN_SILENCED 0x0100U |
| 78 |
> |
enum |
| 79 |
> |
{ |
| 80 |
> |
MODE_PRIVATE = 0x00000001U, /**< */ |
| 81 |
> |
MODE_SECRET = 0x00000002U, /**< Channel does not show up on NAMES or LIST */ |
| 82 |
> |
MODE_MODERATED = 0x00000004U, /**< Users without +v/+h/+o cannot send text to the channel */ |
| 83 |
> |
MODE_TOPICLIMIT = 0x00000008U, /**< Only chanops can change the topic */ |
| 84 |
> |
MODE_INVITEONLY = 0x00000010U, /**< Only invited users may join this channel */ |
| 85 |
> |
MODE_NOPRIVMSGS = 0x00000020U, /**< Users must be in the channel to send text to it */ |
| 86 |
> |
MODE_SSLONLY = 0x00000040U, /**< Prevents anyone who isn't connected via SSL/TLS from joining the channel */ |
| 87 |
> |
MODE_OPERONLY = 0x00000080U, /**< Prevents anyone who hasn't obtained IRC operator status from joining the channel */ |
| 88 |
> |
MODE_REGISTERED = 0x00000100U, /**< Channel has been registered with ChanServ */ |
| 89 |
> |
MODE_REGONLY = 0x00000200U, /**< Only registered clients may join a channel with that mode set */ |
| 90 |
> |
MODE_NOCTRL = 0x00000400U, /**< Prevents users from sending messages containing control codes to the channel */ |
| 91 |
> |
MODE_MODREG = 0x00000800U, /**< Unregistered/unidentified clients cannot send text to the channel */ |
| 92 |
> |
MODE_NOCTCP = 0x00001000U /**< Clients cannot send CTCP messages to the channel */ |
| 93 |
> |
}; |
| 94 |
|
|
| 95 |
|
/* name invisible */ |
| 96 |
|
#define SecretChannel(x) (((x)->mode.mode & MODE_SECRET)) |
| 112 |
|
const char *arg; |
| 113 |
|
const char *id; |
| 114 |
|
int dir; |
| 106 |
– |
int mems; |
| 115 |
|
}; |
| 116 |
|
|
| 117 |
|
struct mode_letter |
| 126 |
|
extern int add_id(struct Client *, struct Channel *, char *, unsigned int); |
| 127 |
|
extern void set_channel_mode(struct Client *, struct Channel *, |
| 128 |
|
struct Membership *, int, char **); |
| 129 |
< |
extern void clear_ban_cache(struct Channel *); |
| 129 |
> |
extern void clear_ban_cache_channel(struct Channel *); |
| 130 |
|
extern void clear_ban_cache_client(struct Client *); |
| 131 |
|
#endif /* INCLUDED_channel_mode_h */ |