summaryrefslogtreecommitdiff
path: root/include/channels.h
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-21 06:31:17 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-21 06:31:17 +0000
commit0ed0fa4af62554a7281d403b6895b29e198e8186 (patch)
tree4b0509084ef8181790f19c258c3bc1f5e38b80cc /include/channels.h
parent15817208aae1c80e2b03668981ac9268d6a02dde (diff)
Rewrote how Anope stores channel status modes on users.
This allows 3rd party modules to add and track their own status mode. Additionally we now store a users status in both the UserContainer and ChannelContainer. This also fixes the ModeStacker to not send any mode strings unnecessarially and shuffles some code around so we don't have to manually remove channels from users lists everywhere. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2775 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/channels.h')
-rw-r--r--include/channels.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/channels.h b/include/channels.h
index 3baae9f1b..e543370b4 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -35,6 +35,7 @@ struct UserContainer
{
User *user;
UserData *ud;
+ Flags<ChannelModeName> *Status;
UserContainer(User *u) : user(u) { ud = new UserData; }
virtual ~UserContainer() { delete ud; }
@@ -109,6 +110,27 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
*/
void DeleteUser(User *u);
+ /** Check if the user is on the channel
+ * @param u The user
+ * @return A user container if found, else NULL
+ */
+ UserContainer *FindUser(User *u);
+
+ /** Check if a user has a status on a channel
+ * @param u The user
+ * @param cms The status mode, or NULL to represent no status
+ * @return true or false
+ */
+ bool HasUserStatus(User *u, ChannelModeStatus *cms);
+
+ /** Check if a user has a status on a channel
+ * Use the overloaded function for ChannelModeStatus* to check for no status
+ * @param u The user
+ * @param Name The Mode name, eg CMODE_OP, CMODE_VOICE
+ * @return true or false
+ */
+ bool HasUserStatus(User *u, ChannelModeName Name);
+
/** See if the channel has any modes at all
* @return true or false
*/