diff options
| author | Adam <Adam@anope.org> | 2010-11-30 03:02:33 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-12-12 19:37:02 -0500 |
| commit | 0ba566491ea246fcc895862d0ef80bdf4ee43b4b (patch) | |
| tree | 9852671d32476ddad58e264a8e074c41fef9f69f /include/regchannel.h | |
| parent | 2a4d57a1cacd22084abea5dd21c87dc733a7b5bf (diff) | |
Allowing adding hostmasks to channel access lists
Diffstat (limited to 'include/regchannel.h')
| -rw-r--r-- | include/regchannel.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/include/regchannel.h b/include/regchannel.h index 760a91f5f..71deb1ce7 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -132,14 +132,15 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, /** Add an entry to the channel access list * - * @param nc The NickCore of the user that the access entry should be tied to + * @param mask The mask of the access entry * @param level The channel access level the user has on the channel * @param creator The user who added the access * @param last_seen When the user was last seen within the channel + * @return The new access class * * Creates a new access list entry and inserts it into the access list. */ - void AddAccess(NickCore *nc, int16 level, const Anope::string &creator, int32 last_seen = 0); + ChanAccess *AddAccess(const Anope::string &mask, int16 level, const Anope::string &creator, int32 last_seen = 0); /** Get an entry from the channel access list by index * @@ -150,15 +151,35 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, */ ChanAccess *GetAccess(unsigned index); + /** Get an entry from the channel access list by User + * + * @param u The User to find within the access list vector + * @param level Optional channel access level to compare the access entries to + * @return A ChanAccess struct corresponding to the User, or NULL if not found + * + * Retrieves an entry from the access list that matches the given User, optionally also matching a certain level. + */ + ChanAccess *GetAccess(User *u, int16 level = 0); + /** Get an entry from the channel access list by NickCore * - * @param nc The NickCore to find within the access list vector + * @param u The NickCore to find within the access list vector * @param level Optional channel access level to compare the access entries to * @return A ChanAccess struct corresponding to the NickCore, or NULL if not found * * Retrieves an entry from the access list that matches the given NickCore, optionally also matching a certain level. */ - ChanAccess *GetAccess(const NickCore *nc, int16 level = 0); + ChanAccess *GetAccess(NickCore *nc, int16 level = 0); + + /** Get an entry from the channel access list by mask + * + * @param u The mask to find within the access list vector + * @param level Optional channel access level to compare the access entries to + * @return A ChanAccess struct corresponding to the mask, or NULL if not found + * + * Retrieves an entry from the access list that matches the given mask, optionally also matching a certain level. + */ + ChanAccess *GetAccess(const Anope::string &mask, int16 level = 0); /** Get the size of the accss vector for this channel * @return The access vector size @@ -173,6 +194,14 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, */ void EraseAccess(unsigned index); + /** Erase an entry from the channel access list + * + * @param access The access to remove + * + * Clears the memory used by the given access entry and removes it from the vector. + */ + void EraseAccess(ChanAccess *access); + /** Clear the entire channel access list * * Clears the entire access list by deleting every item and then clearing the vector. |
