/** RFC1459 channel modes
*/
enum ChannelModes {
- CM_TOPICLOCK = 't'-65,
- CM_NOEXTERNAL = 'n'-65,
- CM_INVITEONLY = 'i'-65,
- CM_MODERATED = 'm'-65,
- CM_SECRET = 's'-65,
- CM_PRIVATE = 'p'-65,
- CM_KEY = 'k'-65,
- CM_LIMIT = 'l'-65
+ CM_TOPICLOCK = 't'-65, /* +t: Only operators can change topic */
+ CM_NOEXTERNAL = 'n'-65, /* +n: Only users in the channel can message it */
+ CM_INVITEONLY = 'i'-65, /* +i: Invite only */
+ CM_MODERATED = 'm'-65, /* +m: Only voices and above can talk */
+ CM_SECRET = 's'-65, /* +s: Secret channel */
+ CM_PRIVATE = 'p'-65, /* +p: Private channel */
+ CM_KEY = 'k'-65, /* +k: Keyed channel */
+ CM_LIMIT = 'l'-65 /* +l: Maximum user limit */
};
+/* Forward declarations - needed */
class userrec;
class chanrec;
/** used to hold a channel and a users modes on that channel, e.g. +v, +h, +o
*/
enum UserChannelModes {
- UCMODE_OP = 1,
- UCMODE_VOICE = 2,
- UCMODE_HOP = 4
+ UCMODE_OP = 1, /* Opped user */
+ UCMODE_VOICE = 2, /* Voiced user */
+ UCMODE_HOP = 4 /* Halfopped user */
};
+/* Forward declaration -- required */
class InspIRCd;
/** A stored prefix and its rank
* This class represents a channel, and contains its name, modes, time created, topic, topic set time,
* etc, and an instance of the BanList type.
*/
-class chanrec : public Extensible
+class CoreExport chanrec : public Extensible
{
private:
*/
static chanrec* ForceChan(InspIRCd* Instance, chanrec* Ptr, userrec* user, const std::string &privs);
+ /** Set default modes for the channel on creation
+ */
+ void SetDefaultModes();
+
+ /** A list of prefixes associated with each user in the channel
+ * (e.g. &%+ etc)
+ */
prefixlist prefixes;
/** Maximum number of bans (cached)
int maxbans;
public:
- /** The channels name.
+ /** The channel's name.
*/
char name[CHANMAX];
*/
char modes[64];
- /** User lists
+ /** User lists.
* There are four user lists, one for
* all the users, one for the ops, one for
* the halfops and another for the voices.
*/
CUList internal_userlist;
- /** Opped users
+ /** Opped users.
+ * There are four user lists, one for
+ * all the users, one for the ops, one for
+ * the halfops and another for the voices.
*/
CUList internal_op_userlist;
- /** Halfopped users
+ /** Halfopped users.
+ * There are four user lists, one for
+ * all the users, one for the ops, one for
+ * the halfops and another for the voices.
*/
CUList internal_halfop_userlist;
- /** Voiced users
+ /** Voiced users.
+ * There are four user lists, one for
+ * all the users, one for the ops, one for
+ * the halfops and another for the voices.
*/
CUList internal_voice_userlist;
- /** Parameters for custom modes
+ /** Parameters for custom modes.
+ * One for each custom mode letter.
*/
CustomModeList custom_mode_params;
* If this is an empty string, no channel topic is set.
*/
char topic[MAXTOPIC];
+
/** Creation time.
+ * This is a timestamp (TS) value.
*/
time_t created;
+
/** Time topic was set.
* If no topic was ever set, this will be equal to chanrec::created
*/
time_t topicset;
+
/** The last user to set the topic.
* If this member is an empty string, no topic was ever set.
*/
*/
void AddVoicedUser(userrec* user);
- /** Delete a user pointer to the internal reference list
+ /** Delete a user pointer to the internal reference list
* @param user The user to delete
* @return number of users left on the channel after deletion of the user
- */
+ */
unsigned long DelUser(userrec* user);
/** Delete a user pointer to the internal reference list of opped users
/** Write to all users on a channel except a list of users, using va_args for text
* @param user User whos details to prefix the line with, and to omit from receipt of the message
* @param serversource If this parameter is true, use the local server name as the source of the text, otherwise,
- * use the nick!user@host of the user.
+ * use the nick!user@host of the user.
* @param status The status of the users to write to, e.g. '@' or '%'. Use a value of 0 to write to everyone
* @param except_list A list of users NOT to send the text to
* @param text A printf-style format string which builds the output line without prefix
* Internally, this calls WriteAllExcept().
* @param user User whos details to prefix the line with, and to omit from receipt of the message
* @param serversource If this parameter is true, use the local server name as the source of the text, otherwise,
- * use the nick!user@host of the user.
+ * use the nick!user@host of the user.
* @param status The status of the users to write to, e.g. '@' or '%'. Use a value of 0 to write to everyone
* @param text A std::string containing the output line without prefix
*/
/** Write to all users on a channel except a list of users, using std::string for text
* @param user User whos details to prefix the line with, and to omit from receipt of the message
* @param serversource If this parameter is true, use the local server name as the source of the text, otherwise,
- * use the nick!user@host of the user.
+ * use the nick!user@host of the user.
* @param status The status of the users to write to, e.g. '@' or '%'. Use a value of 0 to write to everyone
* @param except_list A list of users NOT to send the text to
* @param text A std::string containing the output line without prefix