From 147b3241bde44240de2ea14623a44c6f4207e353 Mon Sep 17 00:00:00 2001 From: me_desk Date: Sun, 13 Oct 2013 11:05:53 +0000 Subject: contacts now have type - temporary, regular, blacklisted. On incoming connections from previously unknown peers new temporary contact record will be created git-svn-id: svn://localhost/project_picapica/trunk@278 fb96df88-216d-11de-830c-f3023f12d8ac --- pica-client/contacts.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'pica-client/contacts.h') diff --git a/pica-client/contacts.h b/pica-client/contacts.h index f3f7663..34c7742 100644 --- a/pica-client/contacts.h +++ b/pica-client/contacts.h @@ -9,23 +9,35 @@ class Contacts { public: + + enum ContactType + { + temporary = 0, + regular = 1, + blacklisted = 2 + }; + struct ContactRecord { QByteArray id; QString name; + + ContactType type; }; Contacts(QString storage, QByteArray user_account_id); - void Add(QByteArray id); + bool Exists(QByteArray id); + void Add(QByteArray id, ContactType type = regular); void Delete(QByteArray id); - QList GetContacts(); + QList GetContacts(ContactType type = regular); QString GetContactCert(QByteArray id); QString GetContactName(QByteArray id); void SetContactCert(QByteArray id, QString &cert_pem); void SetContactName(QByteArray id, QString name); QString GetLastError(); bool isOK(); + private: QSqlDatabase dbconn; QSqlError lasterr; -- cgit v1.2.1