summaryrefslogtreecommitdiff
path: root/include/account.h
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-09-10 15:15:34 +0100
committerGitHub <noreply@github.com>2020-09-10 15:15:34 +0100
commit8180dd414ecd43758290c20315e70af72f0833bf (patch)
tree195ea018ed2d477a114b422caee94053419e77ef /include/account.h
parentff28985384cb6e60fc7479f93778c4363c322ea7 (diff)
Implement support for immutable account identifiers.
Diffstat (limited to 'include/account.h')
-rw-r--r--include/account.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/account.h b/include/account.h
index 8cb2e7a8e..a65c390ea 100644
--- a/include/account.h
+++ b/include/account.h
@@ -20,9 +20,11 @@
typedef Anope::hash_map<NickAlias *> nickalias_map;
typedef Anope::hash_map<NickCore *> nickcore_map;
+typedef TR1NS::unordered_map<uint64_t, NickCore *> nickcoreid_map;
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
+extern CoreExport nickcoreid_map NickCoreIdList;
/* A registered nickname.
* It matters that Base is here before Extensible (it is inherited by Serializable)
@@ -107,6 +109,8 @@ class CoreExport NickCore : public Serializable, public Extensible
{
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
+ /* Unique identifier for the account. */
+ uint64_t id;
public:
/* Name of the account. Find(display)->nc == this. */
Anope::string display;
@@ -140,8 +144,9 @@ class CoreExport NickCore : public Serializable, public Extensible
/** Constructor
* @param display The display nick
+ * @param id The account id
*/
- NickCore(const Anope::string &nickdisplay);
+ NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0);
~NickCore();
void Serialize(Serialize::Data &data) const anope_override;
@@ -178,6 +183,9 @@ class CoreExport NickCore : public Serializable, public Extensible
*/
unsigned GetAccessCount() const;
+ /** Retrieves the account id for this user */
+ uint64_t GetId();
+
/** Find an entry in the nick's access list
*
* @param entry The nick!ident@host entry to search for