summaryrefslogtreecommitdiff
path: root/src/contact.h
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/contact.h
parentd563500c915de2f0a652513af03f101c99715db3 (diff)
Contact list in shared state
Diffstat (limited to 'src/contact.h')
-rw-r--r--src/contact.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/contact.h b/src/contact.h
new file mode 100644
index 0000000..31deceb
--- /dev/null
+++ b/src/contact.h
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <erebos/contact.h>
+
+#include <mutex>
+#include <optional>
+#include <string>
+#include <vector>
+
+namespace erebos {
+
+using std::optional;
+using std::string;
+using std::vector;
+
+struct ContactData;
+struct IdentityData;
+
+struct Contact::Priv
+{
+ vector<Stored<ContactData>> data;
+ Identity identity;
+
+ void init();
+ std::once_flag initFlag {};
+
+ optional<string> name {};
+
+ static List<Contact> loadList(vector<Stored<ContactData>> &&, vector<Identity> &&);
+};
+
+struct ContactData
+{
+ static ContactData load(const Ref &);
+ Ref store(const Storage &) const;
+
+ vector<Stored<ContactData>> prev;
+ vector<Stored<Signed<IdentityData>>> identity;
+ optional<string> name;
+};
+
+}