]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/channels.h
Add m_nickflood: Provides usermode +F nickchanges:seconds - allows nickchanges:second...
[user/henk/code/inspircd.git] / include / channels.h
index f68f838894e8defb9460763bd09f99c1bc10f049..b4fa1ca3064d430f3aeb67eb1e4a40260c198ec1 100644 (file)
 /** 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;
 
@@ -87,11 +88,12 @@ typedef std::map<char,char*> CustomModeList;
 /** 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
@@ -110,7 +112,7 @@ typedef std::map<userrec*, std::vector<prefixtype> > prefixlist;
  * 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:
 
@@ -122,6 +124,13 @@ class chanrec : public Extensible
         */
        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)
@@ -129,7 +138,7 @@ class chanrec : public Extensible
        int maxbans;
 
  public:
-       /** The channels name.
+       /** The channel's name.
         */
        char name[CHANMAX];
 
@@ -141,26 +150,36 @@ class chanrec : public Extensible
         */
        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;
 
@@ -168,13 +187,17 @@ class chanrec : public Extensible
         * 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.
         */
@@ -258,10 +281,10 @@ class chanrec : public Extensible
         */
        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
@@ -394,7 +417,7 @@ class chanrec : public Extensible
        /** 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
@@ -406,7 +429,7 @@ class chanrec : public Extensible
         * 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
         */
@@ -415,7 +438,7 @@ class chanrec : public Extensible
        /** 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