4 Revision 1.1 2003/01/23 19:45:58 brain
7 Revision 1.7 2003/01/22 00:44:26 brain
8 Added documentation comments
10 Revision 1.6 2003/01/21 21:11:17 brain
13 Revision 1.5 2003/01/16 20:11:55 brain
14 fixed some ugly pointer bugs (thanks dblack and a|KK|y!)
16 Revision 1.4 2003/01/15 22:47:44 brain
17 Changed user and channel structs to classes (finally)
22 #include "inspircd_config.h"
26 #ifndef __CHANNELS_H__
27 #define __CHANNELS_H__
29 /** Holds an entry for a ban list, exemption list, or invite list.
30 * This class contains a single element in a channel list, such as a banlist.
39 HostItem() { /* stub */ }
40 virtual ~HostItem() { /* stub */ }
43 // banlist is inherited from HostList mainly for readability
46 /** A subclass of HostItem designed to hold channel bans (+b)
48 class BanItem : public HostItem
54 /** A subclass of HostItem designed to hold channel exempts (+e)
56 class ExemptItem : public HostItem
62 /** A subclass of HostItem designed to hold channel invites (+I)
64 class InviteItem : public HostItem
69 /** Holds a complete ban list
71 typedef vector<BanItem> BanList;
73 /** Holds a complete exempt list
75 typedef vector<ExemptItem> ExemptList;
77 /** Holds a complete invite list
79 typedef vector<InviteItem> InviteList;
81 /** Holds all relevent information for a channel.
82 * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
83 * etc, and an instance of the BanList type.
88 /** The channels name.
90 char name[CHANMAX]; /* channel name */
91 /** Custom modes for the channel.
92 * Plugins may use this field in any way they see fit.
94 char custom_modes[MAXMODES]; /* modes handled by modules */
96 * If this is an empty string, no channel topic is set.
102 /** Time topic was set.
103 * If no topic was ever set, this will be equal to chanrec::created
106 /** The last user to set the topic.
107 * If this member is an empty string, no topic was ever set.
111 /** Contains the channel user limit.
112 * If this value is zero, there is no limit in place.
116 /** Contains the channel key.
117 * If this value is an empty string, there is no channel key in place.
121 /** Nonzero if the mode +t is set.
125 /** Nonzero if the mode +n is set.
127 short int noexternal;
129 /** Nonzero if the mode +i is set.
131 short int inviteonly;
133 /** Nonzero if the mode +m is set.
137 /** Nonzero if the mode +s is set.
138 * This value cannot be set at the same time as chanrec::c_private
142 /** Nonzero if the mode +p is set.
143 * This value cannot be set at the same time as chanrec::secret
147 /** The list of all bans set on the channel.
151 /** Creates a channel record and initialises it with default values
156 strcpy(custom_modes,"");
160 created = topicset = limit = 0;
161 topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
164 virtual ~chanrec() { /* stub */ }
167 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
168 * needs to come AFTER struct chanrec */
171 #define UCMODE_VOICE 2
173 #define UCMODE_PROTECT 8
174 #define UCMODE_FOUNDER 16
176 /** Holds a user's modes on a channel
177 * This class associates a users privilages with a channel by creating a pointer link between
178 * a userrec and chanrec class. The uc_modes member holds a bitmask of which privilages the user
179 * has on the channel, such as op, voice, etc.
184 /** Contains a bitmask of the UCMODE_OP ... UCMODE_FOUNDER values.
185 * If this value is zero, the user has no privilages upon the channel.
189 /** Points to the channel record where the given modes apply.
190 * If the record is not in use, this value will be NULL.
194 ucrec() { /* stub */ }
195 virtual ~ucrec() { /* stub */ }