summaryrefslogtreecommitdiff
path: root/src/contact.h
diff options
context:
space:
mode:
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;
+};
+
+}