]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/channels.h
Document base modes
[user/henk/code/inspircd.git] / include / channels.h
index aa34ceb3cd98f9ec04e2e67d2d4458ad7fe23dd5..8f3b8ba3d493d15e775936b733dfc6af3bc32cf4 100644 (file)
@@ -142,6 +142,8 @@ class ucrec : public classbase
        virtual ~ucrec() { /* stub */ }
 };
 
+class InspIRCd;
+
 
 /** Holds all relevent information for a channel.
  * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
@@ -151,9 +153,13 @@ class chanrec : public Extensible
 {
  private:
 
+       /** Pointer to creator object
+        */
+       InspIRCd* ServerInstance;
+
        /** Connect a chanrec to a userrec
         */
-       static chanrec* ForceChan(chanrec* Ptr,ucrec *a,userrec* user, int created);
+       static chanrec* ForceChan(InspIRCd* Instance, chanrec* Ptr,ucrec *a,userrec* user, int created);
 
  public:
        /** The channels name.
@@ -341,7 +347,7 @@ class chanrec : public Extensible
        /** Creates a channel record and initialises it with default values
         * @throw Nothing at present.
         */
-       chanrec();
+       chanrec(InspIRCd* Instance);
 
        /** Make src kick user from this channel with the given reason.
         * @param src The source of the kick
@@ -379,7 +385,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(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 = "");
 
        /** Write to a channel, from a user, using va_args for text
         * @param user User whos details to prefix the line with
@@ -422,6 +428,46 @@ class chanrec : public Extensible
         */
        void WriteAllExceptSender(userrec* user, char status, const std::string& text);
 
+       /** Returns the maximum number of bans allowed to be set on this channel
+        * @return The maximum number of bans allowed
+        */
+       long GetMaxBans();
+
+       /** Return the channel's modes with parameters.
+        * @param showkey If this is set to true, the actual key is shown,
+        * otherwise it is replaced with '<KEY>'
+        * @return The channel mode string
+        */
+       char* ChanModes(bool showkey);
+
+       /** Spool the NAMES list for this channel to the given user
+        * @param The user to spool the NAMES list to
+        */
+       void UserList(userrec *user);
+
+       /** Get the number of invisible users on this channel
+        * @return Number of invisible users
+        */
+       int CountInvisible();
+
+       /** Get a users status on this channel
+        * @param The user to look up
+        * @return One of STATUS_OP, STATUS_HOP, STATUS_VOICE, or zero.
+        */
+       int GetStatus(userrec *user);
+
+       /** Get a users status on this channel in a bitmask
+        * @param The user to look up
+        * @return A bitmask containing zero or more of STATUS_OP, STATUS_HOP, STATUS_VOICE
+        */
+       int GetStatusFlags(userrec *user);
+
+       /** Get a users status on this channel in a string
+        * @param The user to look up
+        * @return A character array containing the string "@", "%", "+" or ""
+        */
+       const char* GetStatusChar(userrec *user);
+
        /** Destructor for chanrec
         */
        virtual ~chanrec() { /* stub */ }