diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-04 23:49:27 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-04 23:49:27 +0000 |
commit | 308070e01971b0cfaf77de20011f48ce4d6b5a1c (patch) | |
tree | 2bdfd84e35cf79eb20dc2a79ddd233789ca84fdf /include | |
parent | 3d4cf39940144be19645a3a7cdecf95213b96f26 (diff) |
We now store a list of users using a NickCore in the NickCore, this prevents having to loop every user all the time to find them
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2780 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r-- | include/account.h | 2 | ||||
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/users.h | 22 |
3 files changed, 22 insertions, 3 deletions
diff --git a/include/account.h b/include/account.h index 02e6508d4..3f39c3b4a 100644 --- a/include/account.h +++ b/include/account.h @@ -122,6 +122,8 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag> NickCore *next, *prev; + std::list<User *> Users; + char *display; /* How the nick is displayed */ std::string pass; /* Password of the nicks */ char *email; /* E-mail associated to the nick */ diff --git a/include/extern.h b/include/extern.h index 6c147897a..a4ed84ac1 100644 --- a/include/extern.h +++ b/include/extern.h @@ -385,7 +385,6 @@ E void ns_init(); E void nickserv(User * u, char *buf); E int validate_user(User * u); E void cancel_user(User * u); -E int nick_identified(User * u); E void expire_nicks(); E void expire_requests(); EI int ns_do_register(User * u); diff --git a/include/users.h b/include/users.h index dba200770..525df393b 100644 --- a/include/users.h +++ b/include/users.h @@ -30,6 +30,7 @@ class CoreExport User : public Extensible bool OnAccess; /* If the user is on the access list of the nick theyre on */ std::bitset<128> modes; /* Bitset of mode names the user has set on them */ std::map<UserModeName, std::string> Params; /* Map of user modes and the params this user has */ + NickCore *nc; /* NickCore account the user is currently loggged in as */ public: // XXX: exposing a tiny bit too much User *next, *prev; @@ -45,8 +46,6 @@ class CoreExport User : public Extensible time_t timestamp; /* Timestamp of the nick */ time_t my_signon; /* When did _we_ see the user? */ - NickCore *nc; - int isSuperAdmin; /* is SuperAdmin on or off? */ /* Channels the user is in */ @@ -155,6 +154,25 @@ class CoreExport User : public Extensible */ void AutoID(const char *acc); + /** Login the user to a NickCore + * @param core The account the user is useing + */ + void Login(NickCore *core); + + /** Logout the user + */ + void Logout(); + + /** Get the account the user is logged in using + * @reurn The account or NULL + */ + NickCore *Account() const; + + /** Check if the user is identified for their nick + * @return true or false + */ + const bool IsIdentified() const; + /** Check if the user is recognized for their nick (on the nicks access list) * @return true or false */ |