X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fchannels.h;h=489c8b0e868886b511cab3df4df45956e2af2182;hb=b83765d756c2568d15b87654963b5237d0482367;hp=e9dcfb1336cf5f859ca565c59c68fb417420be61;hpb=396c9ef9f7a96934d3227bb7d1d091315e3d4fa8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/channels.h b/include/channels.h index e9dcfb133..489c8b0e8 100644 --- a/include/channels.h +++ b/include/channels.h @@ -144,6 +144,9 @@ class ucrec : public classbase class InspIRCd; +typedef std::pair prefixtype; +typedef std::vector pfxcontainer; +typedef std::map > prefixlist; /** Holds all relevent information for a channel. * This class represents a channel, and contains its name, modes, time created, topic, topic set time, @@ -161,6 +164,8 @@ class chanrec : public Extensible */ static chanrec* ForceChan(InspIRCd* Instance, chanrec* Ptr,ucrec *a,userrec* user, int created); + prefixlist prefixes; + public: /** The channels name. */ @@ -428,14 +433,50 @@ 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); + + void RemoveAllPrefixes(userrec* user); + + void SetPrefix(userrec* user, char prefix, unsigned int prefix_rank, bool adding); + /** Destructor for chanrec */ virtual ~chanrec() { /* stub */ }