1
0
Fork 0
forked from blue/squawk

keep going on refactoring vcard

This commit is contained in:
Blue 2023-02-02 21:39:38 +03:00
parent 4af16b75bf
commit edf1ee60cd
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 483 additions and 55 deletions

View file

@ -118,6 +118,16 @@ Q_ENUM_NS(AccountPassword)
static const AccountPassword AccountPasswordHighest = AccountPassword::kwallet;
static const AccountPassword AccountPasswordLowest = AccountPassword::plain;
enum class EntryType {
contact,
conference,
presence,
participant
};
Q_ENUM_NS(EntryType)
static const EntryType EntryTypeHighest = EntryType::participant;
static const EntryType EntryTypeLowest = EntryType::contact;
enum class Support {
unknown,
supported,

View file

@ -16,7 +16,8 @@
#include "info.h"
Shared::Info::Info(const QString& p_jid, bool p_editable):
Shared::Info::Info(const QString& p_jid, EntryType p_type, bool p_editable):
type(p_type),
jid(p_jid),
editable(p_editable),
vcard(),
@ -25,6 +26,7 @@ Shared::Info::Info(const QString& p_jid, bool p_editable):
{}
Shared::Info::Info():
type(EntryType::contact),
jid(),
editable(false),
vcard(),
@ -33,6 +35,7 @@ Shared::Info::Info():
{}
Shared::Info::Info(const Shared::Info& other):
type(other.type),
jid(other.jid),
editable(other.editable),
vcard(other.vcard),

View file

@ -19,6 +19,7 @@
#include "vcard.h"
#include "keyinfo.h"
#include "enums.h"
#include <list>
@ -33,10 +34,11 @@ namespace Shared {
class Info {
public:
Info();
Info(const QString& jid, bool editable = false);
Info(const QString& jid, EntryType = EntryType::contact, bool editable = false);
Info(const Info& other);
~Info();
EntryType type;
QString jid;
bool editable;
VCard vcard;