6 #include "inspircd_config.h"
11 #ifndef __CHANNELS_H__
12 #define __CHANNELS_H__
14 /** Holds an entry for a ban list, exemption list, or invite list.
15 * This class contains a single element in a channel list, such as a banlist.
17 class HostItem : public classbase
24 HostItem() { /* stub */ }
25 virtual ~HostItem() { /* stub */ }
28 // banlist is inherited from HostList mainly for readability
31 /** A subclass of HostItem designed to hold channel bans (+b)
33 class BanItem : public HostItem
39 /** A subclass of HostItem designed to hold channel exempts (+e)
41 class ExemptItem : public HostItem
47 /** A subclass of HostItem designed to hold channel invites (+I)
49 class InviteItem : public HostItem
54 /** Holds a complete ban list
56 typedef std::vector<BanItem> BanList;
58 /** Holds a complete exempt list
60 typedef std::vector<ExemptItem> ExemptList;
62 /** Holds a complete invite list
64 typedef std::vector<InviteItem> InviteList;
66 /** Holds all relevent information for a channel.
67 * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
68 * etc, and an instance of the BanList type.
70 class chanrec : public classbase
73 /** The channels name.
75 char name[CHANMAX]; /* channel name */
76 /** Custom modes for the channel.
77 * Plugins may use this field in any way they see fit.
79 char custom_modes[MAXMODES]; /* modes handled by modules */
81 * If this is an empty string, no channel topic is set.
87 /** Time topic was set.
88 * If no topic was ever set, this will be equal to chanrec::created
91 /** The last user to set the topic.
92 * If this member is an empty string, no topic was ever set.
96 /** Contains the channel user limit.
97 * If this value is zero, there is no limit in place.
101 /** Contains the channel key.
102 * If this value is an empty string, there is no channel key in place.
106 /** Nonzero if the mode +t is set.
110 /** Nonzero if the mode +n is set.
112 short int noexternal;
114 /** Nonzero if the mode +i is set.
116 short int inviteonly;
118 /** Nonzero if the mode +m is set.
122 /** Nonzero if the mode +s is set.
123 * This value cannot be set at the same time as chanrec::c_private
127 /** Nonzero if the mode +p is set.
128 * This value cannot be set at the same time as chanrec::secret
132 /** The list of all bans set on the channel.
136 /** Sets or unsets a custom mode in the channels info
138 void SetCustomMode(char mode,bool mode_on);
140 /** Sets or unsets the parameterrs for a custom mode in a channels info
142 void SetCustomModeParam(char mode,char* parameter,bool mode_on);
144 /** Creates a channel record and initialises it with default values
148 virtual ~chanrec() { /* stub */ }
151 /* used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
152 * needs to come AFTER struct chanrec */
155 #define UCMODE_VOICE 2
157 #define UCMODE_PROTECT 8
158 #define UCMODE_FOUNDER 16
160 /** Holds a user's modes on a channel
161 * This class associates a users privilages with a channel by creating a pointer link between
162 * a userrec and chanrec class. The uc_modes member holds a bitmask of which privilages the user
163 * has on the channel, such as op, voice, etc.
165 class ucrec : public classbase
168 /** Contains a bitmask of the UCMODE_OP ... UCMODE_FOUNDER values.
169 * If this value is zero, the user has no privilages upon the channel.
173 /** Points to the channel record where the given modes apply.
174 * If the record is not in use, this value will be NULL.
178 ucrec() { /* stub */ }
179 virtual ~ucrec() { /* stub */ }