From d3d64c27b199622c90075d6f59dd08e44acbb378 Mon Sep 17 00:00:00 2001 From: Adam- Date: Tue, 13 Oct 2009 21:26:38 +0000 Subject: Complete rewrite of everything associated with modes, this breaks saving and reading mlocked modes from the databases until the new databases are implemented git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2560 5417fbe8-f217-4b02-8779-1006273d7864 --- include/users.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'include/users.h') diff --git a/include/users.h b/include/users.h index 1f7f617d3..f54be8982 100644 --- a/include/users.h +++ b/include/users.h @@ -8,6 +8,7 @@ * $Id$ * */ + struct u_chanlist { struct u_chanlist *next, *prev; Channel *chan; @@ -41,7 +42,7 @@ class CoreExport User : public Extensible Server *server; /* Server user is connected to */ time_t timestamp; /* Timestamp of the nick */ time_t my_signon; /* When did _we_ see the user? */ - uint32 mode; /* See below */ + std::bitset<128> modes; NickCore *nc; @@ -161,5 +162,31 @@ class CoreExport User : public Extensible /** Update the last usermask stored for a user, and check to see if they are recognized */ void UpdateHost(); + + /** Check if the user has a mode + * @param Name Mode name + * @return true or false + */ + const bool HasMode(UserModeName Name) const; + + /** Set a mode on the user + * @param Name The mode name + */ + void SetMode(UserModeName Name); + + /* Set a mode on the user + * @param ModeChar The mode char + */ + void SetMode(char ModeChar); + + /** Remove a mode from the user + * @param Name The mode name + */ + void RemoveMode(UserModeName Name); + + /** Remove a mode from the user + * @param ModeChar The mode char + */ + void RemoveMode(char ModeChar); }; -- cgit