ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/channel_mode.h
(Generate patch)

Comparing ircd-hybrid/trunk/include/channel_mode.h (file contents):
Revision 1954 by michael, Mon May 6 18:51:19 2013 UTC vs.
Revision 3707 by michael, Fri May 30 16:20:47 2014 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  channel_mode.h: The ircd channel mode header.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2002 by the past and present ircd coders, and others.
4 > *  Copyright (c) 1997-2014 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
# Line 18 | Line 17
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
21 *
22 *  $Id$
20   */
21  
22 + /*! \file channel_mode.h
23 + * \brief Includes channel mode related definitions and structures.
24 + * \version $Id$
25 + */
26  
27   #ifndef INCLUDED_channel_mode_h
28   #define INCLUDED_channel_mode_h
29  
29 #include "ircd_defs.h"        /* buffer sizes */
30
30   #define MODEBUFLEN    200
31  
32   /* Maximum mode changes allowed per client, per server is different */
33   #define MAXMODEPARAMS 4
34  
35 + enum
36 + {
37 +  MODE_QUERY =  0,
38 +  MODE_ADD   =  1,
39 +  MODE_DEL   = -1
40 + };
41 +
42 + enum
43 + {
44 +  CHACCESS_NOTONCHAN = -1,
45 +  CHACCESS_PEON      =  0,
46 +  CHACCESS_HALFOP    =  1,
47 +  CHACCESS_CHANOP    =  2
48 + };
49 +
50   /* can_send results */
51 < #define CAN_SEND_NO     0
52 < #define CAN_SEND_NONOP  -1
53 < #define CAN_SEND_OPV    -2
51 > enum
52 > {
53 >  CAN_SEND_NO    =  0,
54 >  CAN_SEND_NONOP = -1,
55 >  CAN_SEND_OPV   = -2
56 > };
57  
58  
59   /* Channel related flags */
60   #define CHFL_CHANOP     0x0001 /* Channel operator   */
61   #define CHFL_HALFOP     0x0002 /* Channel half op    */
62   #define CHFL_VOICE      0x0004 /* the power to speak */
63 < #define CHFL_DEOPPED    0x0008 /* deopped by us, modes need to be bounced */
64 < #define CHFL_BAN        0x0010 /* ban channel flag */
65 < #define CHFL_EXCEPTION  0x0020 /* exception to ban channel flag */
49 < #define CHFL_INVEX      0x0040
63 > #define CHFL_BAN        0x0008 /* ban channel flag */
64 > #define CHFL_EXCEPTION  0x0010 /* exception to ban channel flag */
65 > #define CHFL_INVEX      0x0020
66  
67   /* channel modes ONLY */
68 < #define MODE_PRIVATE    0x0001
69 < #define MODE_SECRET     0x0002
70 < #define MODE_MODERATED  0x0004
71 < #define MODE_TOPICLIMIT 0x0008
72 < #define MODE_INVITEONLY 0x0010
73 < #define MODE_NOPRIVMSGS 0x0020
74 < #define MODE_SSLONLY    0x0040
75 < #define MODE_OPERONLY   0x0080
76 < #define MODE_REGISTERED 0x0100 /* Channel has been registered with ChanServ */
77 < #define MODE_REGONLY    0x0200
78 < #define MODE_NOCTRL     0x0400
79 < #define MODE_MODREG     0x0800
68 > #define MODE_PRIVATE    0x0001  /**< */
69 > #define MODE_SECRET     0x0002  /**< Channel does not show up on NAMES or LIST */
70 > #define MODE_MODERATED  0x0004  /**< Users without +v/h/o cannot send text to the channel */
71 > #define MODE_TOPICLIMIT 0x0008  /**< Only chanops can change the topic */
72 > #define MODE_INVITEONLY 0x0010  /**< Only invited usersmay join this channel */
73 > #define MODE_NOPRIVMSGS 0x0020  /**< Users must be in the channel to send text to it */
74 > #define MODE_SSLONLY    0x0040  /**< Prevents anyone who isn't connected via SSL/TLS from joining the channel */
75 > #define MODE_OPERONLY   0x0080  /**< Prevents anyone who hasn't obtained IRC operator status from joining the channel */
76 > #define MODE_REGISTERED 0x0100  /**< Channel has been registered with ChanServ */
77 > #define MODE_REGONLY    0x0200  /**< Only registered clients may join a channel with that mode set */
78 > #define MODE_NOCTRL     0x0400  /**< Prevents users from sending messages containing control codes to the channel */
79 > #define MODE_MODREG     0x0800  /**< Unregistered/unidentified clients cannot send text to the channel */
80  
81   /* cache flags for silence on ban */
82   #define CHFL_BAN_CHECKED  0x0080
83   #define CHFL_BAN_SILENCED 0x0100
84  
69 #define MODE_QUERY  0
70 #define MODE_ADD    1
71 #define MODE_DEL   -1
72
73 #define CHACCESS_NOTONCHAN  -1
74 #define CHACCESS_PEON       0
75 #define CHACCESS_HALFOP     1
76 #define CHACCESS_CHANOP     2
77
85   /* name invisible */
86   #define SecretChannel(x)        (((x)->mode.mode & MODE_SECRET))
87 < #define PubChannel(x)           (!SecretChannel(x))
88 < /* knock is forbidden, halfops can't kick/deop other halfops.
82 < * +pi means paranoid and will generate notices on each invite */
87 > #define PubChannel(x)           (((x)->mode.mode & (MODE_PRIVATE | MODE_SECRET)) == 0)
88 > /* knock is forbidden, halfops can't kick/deop other halfops. */
89   #define PrivateChannel(x)       (((x)->mode.mode & MODE_PRIVATE))
90  
91   struct ChModeChange
# Line 88 | Line 94 | struct ChModeChange
94    const char *arg;
95    const char *id;
96    int dir;
91  unsigned int caps;
92  unsigned int nocaps;
97    int mems;
94  struct Client *client;
95 };
96
97 struct ChCapCombo
98 {
99  int count;
100  unsigned int cap_yes;
101  unsigned int cap_no;
98   };
99  
100   struct mode_letter
# Line 108 | Line 104 | struct mode_letter
104   };
105  
106   extern const struct mode_letter chan_modes[];
107 < extern int add_id(struct Client *, struct Channel *, char *, int);
108 < extern void set_channel_mode(struct Client *, struct Client *, struct Channel *,
109 <                             struct Membership *, int, char **, char *);
107 >
108 > extern int add_id(struct Client *, struct Channel *, char *, unsigned int);
109 > extern void set_channel_mode(struct Client *, struct Channel *,
110 >                             struct Membership *, int, char **);
111   extern void clear_ban_cache(struct Channel *);
112   extern void clear_ban_cache_client(struct Client *);
116 extern void init_chcap_usage_counts(void);
117 extern void set_chcap_usage_counts(struct Client *);
118 extern void unset_chcap_usage_counts(struct Client *);
113   #endif /* INCLUDED_channel_mode_h */

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)