summaryrefslogtreecommitdiff
path: root/src/identity.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-06-05 23:10:24 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2021-06-06 21:48:46 +0200
commit6c58f1e095f7dbe1e7e1654c1807a76276a2f3f2 (patch)
treea4e083c6dca3e6567a0d7983c7c316b85316bf4c /src/identity.cpp
parentd563500c915de2f0a652513af03f101c99715db3 (diff)
Contact list in shared state
Diffstat (limited to 'src/identity.cpp')
-rw-r--r--src/identity.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/identity.cpp b/src/identity.cpp
index f55f6dd..0d35122 100644
--- a/src/identity.cpp
+++ b/src/identity.cpp
@@ -6,6 +6,8 @@
#include <set>
#include <stdexcept>
+#include <iostream>
+
using namespace erebos;
using std::async;
@@ -38,6 +40,11 @@ optional<Identity> Identity::load(const vector<Ref> & refs)
for (const auto & ref : refs)
data.push_back(Stored<Signed<IdentityData>>::load(ref));
+ return load(data);
+}
+
+optional<Identity> Identity::load(const vector<Stored<Signed<IdentityData>>> & data)
+{
if (auto ptr = Priv::validate(data))
return Identity(ptr);
return nullopt;
@@ -61,6 +68,11 @@ vector<Ref> Identity::store(const Storage & st) const
return res;
}
+const vector<Stored<Signed<IdentityData>>> & Identity::data() const
+{
+ return p->data;
+}
+
optional<string> Identity::name() const
{
return p->name.get();