]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/channels.h
Change for reverse output of lists, most recent first, for bug #307. Also fix(Oms...
[user/henk/code/inspircd.git] / include / channels.h
index a85e69dd1ec02a02415196a033672910ea7022a6..950275974cd80c8f7f8ef7aa233c3f09312bd85a 100644 (file)
@@ -69,7 +69,7 @@ typedef std::vector<BanItem>  BanList;
 
 /** A list of users on a channel
  */
-typedef std::map<userrec*,userrec*> CUList;
+typedef std::map<userrec*,std::string> CUList;
 
 /** Shorthand for CUList::iterator
  */
@@ -87,9 +87,9 @@ 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,
+       UCMODE_VOICE    = 2,
+       UCMODE_HOP      = 4
 };
 
 class InspIRCd;
@@ -110,7 +110,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:
 
@@ -124,6 +124,10 @@ class chanrec : public Extensible
 
        prefixlist prefixes;
 
+       /** Maximum number of bans (cached)
+        */
+       int maxbans;
+
  public:
        /** The channels name.
         */
@@ -174,7 +178,7 @@ class chanrec : public Extensible
        /** The last user to set the topic.
         * If this member is an empty string, no topic was ever set.
         */
-       char setby[NICKMAX];
+       char setby[128];
 
        /** Contains the channel user limit.
         * If this value is zero, there is no limit in place.
@@ -254,10 +258,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
@@ -348,7 +352,7 @@ class chanrec : public Extensible
         * been created if the channel did not exist before the user was joined to it.
         * If the user could not be joined to a channel, the return value may be NULL.
         */
-       static chanrec* JoinUser(InspIRCd* ServerInstance, userrec *user, const char* cn, bool override, const char* key = "");
+       static chanrec* JoinUser(InspIRCd* ServerInstance, userrec *user, const char* cn, bool override, const char* key, time_t TS = 0);
 
        /** Write to a channel, from a user, using va_args for text
         * @param user User whos details to prefix the line with
@@ -390,7 +394,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
@@ -402,7 +406,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
         */
@@ -411,7 +415,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
@@ -432,8 +436,10 @@ class chanrec : public Extensible
 
        /** Spool the NAMES list for this channel to the given user
         * @param user The user to spool the NAMES list to
+        * @param ulist The user list to send, NULL to use the
+        * channel's default names list of everyone
         */
-       void UserList(userrec *user);
+       void UserList(userrec *user, CUList* ulist = NULL);
 
        /** Get the number of invisible users on this channel
         * @return Number of invisible users
@@ -510,6 +516,10 @@ class chanrec : public Extensible
         */
        bool IsBanned(userrec* user);
 
+       /** Clears the cached max bans value
+        */
+       void ResetMaxBans();
+
        /** Destructor for chanrec
         */
        virtual ~chanrec() { /* stub */ }