From e4b5eb30af94991e19ac324d5e6ec616e6a71d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 3 Dec 2023 22:52:26 +0100 Subject: Contacts with extended identity --- include/erebos/contact.h | 2 +- include/erebos/identity.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/erebos/contact.h b/include/erebos/contact.h index 963e22a..9008ce7 100644 --- a/include/erebos/contact.h +++ b/include/erebos/contact.h @@ -57,7 +57,7 @@ struct ContactData Ref store(const Storage &) const; vector> prev; - vector>> identity; + vector identity; optional name; }; diff --git a/include/erebos/identity.h b/include/erebos/identity.h index 7829361..4792330 100644 --- a/include/erebos/identity.h +++ b/include/erebos/identity.h @@ -71,6 +71,37 @@ private: Identity(std::shared_ptr && p); }; +struct IdentityData; +struct IdentityExtension; + +struct StoredIdentityPart +{ + using Part = variant< + Stored>, + Stored>>; + + StoredIdentityPart(Part p): part(move(p)) {} + + static StoredIdentityPart load(const Ref &); + Ref store(const Storage & st) const; + + bool operator==(const StoredIdentityPart & other) const + { return part == other.part; } + bool operator<(const StoredIdentityPart & other) const + { return part < other.part; } + + const Ref & ref() const; + const Stored> & base() const; + + vector previous() const; + vector roots() const; + optional name() const; + optional owner() const; + bool isSignedBy(const Stored &) const; + + Part part; +}; + DECLARE_SHARED_TYPE(optional) } -- cgit v1.2.3