Hush lite wallet
https://faq.hush.is/sdl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
#ifndef CHATDATASTORE_H
|
|
#define CHATDATASTORE_H
|
|
#include "../chatmodel.h"
|
|
using json = nlohmann::json;
|
|
|
|
class ChatDataStore
|
|
{
|
|
private:
|
|
static bool instanced;
|
|
static ChatDataStore* instance;
|
|
Ui::MainWindow* ui;
|
|
MainWindow* main;
|
|
std::map<QString, ChatItem> data;
|
|
ChatDataStore()
|
|
{
|
|
|
|
}
|
|
|
|
public:
|
|
static ChatDataStore* getInstance();
|
|
void clear();
|
|
void setData(QString key, ChatItem value);
|
|
ChatItem getData(QString key);
|
|
std::map<QString, ChatItem> getAllRawChatItems();
|
|
std::map<QString, ChatItem> getAllNewContactRequests();
|
|
std::map<QString, ChatItem> getAllOldContactRequests();
|
|
std::map<QString, ChatItem> getAllMemos();
|
|
QString getPassword();
|
|
|
|
void setPassword(QString Password);
|
|
QString _password;
|
|
|
|
QString dump();
|
|
|
|
~ChatDataStore()
|
|
{
|
|
ChatDataStore::instanced = false;
|
|
ChatDataStore::instance = nullptr;
|
|
}
|
|
};
|
|
|
|
|
|
|
|
#endif
|