From 1d245e28c9b1b18a45097a72bc4ff166c59c37ba Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 31 Oct 2016 18:45:59 +0100 Subject: Mail::Contact mapping --- common/domain/applicationdomaintype.h | 12 ++++++++++-- common/domain/mail.cpp | 6 +++--- common/domain/mail.fbs | 11 +++++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) (limited to 'common/domain') diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 39ce2b9..b377db9 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -271,10 +271,17 @@ struct SINK_EXPORT Folder : public Entity { }; struct SINK_EXPORT Mail : public Entity { + struct SINK_EXPORT Contact { + QString name; + QString emailAddress; + }; + SINK_ENTITY(Mail); SINK_PROPERTY(QString, Uid, uid); - SINK_EXTRACTED_PROPERTY(QString, Sender, sender); - SINK_EXTRACTED_PROPERTY(QString, SenderName, senderName); + SINK_PROPERTY(Contact, Sender, sender); + SINK_PROPERTY(QList, To, to); + SINK_PROPERTY(QList, Cc, cc); + SINK_PROPERTY(QList, Bcc, bcc); SINK_EXTRACTED_PROPERTY(QString, Subject, subject); SINK_EXTRACTED_PROPERTY(QDateTime, Date, date); SINK_PROPERTY(bool, Unread, unread); @@ -417,5 +424,6 @@ Q_DECLARE_METATYPE(Sink::ApplicationDomain::SinkAccount) Q_DECLARE_METATYPE(Sink::ApplicationDomain::SinkAccount::Ptr) Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity) Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity::Ptr) +Q_DECLARE_METATYPE(Sink::ApplicationDomain::Mail::Contact) Q_DECLARE_METATYPE(Sink::ApplicationDomain::Error) Q_DECLARE_METATYPE(Sink::ApplicationDomain::Progress) diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp index ee58928..5a77681 100644 --- a/common/domain/mail.cpp +++ b/common/domain/mail.cpp @@ -38,7 +38,7 @@ void TypeImplementation::configure(TypeIndex &index) { index.addProperty(Mail::Uid::name); index.addProperty(Mail::Sender::name); - index.addProperty(Mail::SenderName::name); + /* index.addProperty(Mail::SenderName::name); */ /* index->addProperty(Mail::Subject::name); */ /* index->addFulltextProperty(Mail::Subject::name); */ index.addProperty(Mail::Date::name); @@ -68,7 +68,7 @@ void TypeImplementation::configure(ReadPropertyMapper &propertyMap { propertyMapper.addMapping(&Buffer::uid); propertyMapper.addMapping(&Buffer::sender); - propertyMapper.addMapping(&Buffer::senderName); + /* propertyMapper.addMapping(&Buffer::recepients); */ propertyMapper.addMapping(&Buffer::subject); propertyMapper.addMapping(&Buffer::date); propertyMapper.addMapping(&Buffer::unread); @@ -86,7 +86,7 @@ void TypeImplementation::configure(WritePropertyMapper &pro { propertyMapper.addMapping(&BufferBuilder::add_uid); propertyMapper.addMapping(&BufferBuilder::add_sender); - propertyMapper.addMapping(&BufferBuilder::add_senderName); + /* propertyMapper.addMapping(&BufferBuilder::add_senderName); */ propertyMapper.addMapping(&BufferBuilder::add_subject); propertyMapper.addMapping(&BufferBuilder::add_date); propertyMapper.addMapping(&BufferBuilder::add_unread); diff --git a/common/domain/mail.fbs b/common/domain/mail.fbs index f14e9f1..737a671 100644 --- a/common/domain/mail.fbs +++ b/common/domain/mail.fbs @@ -1,10 +1,17 @@ namespace Sink.ApplicationDomain.Buffer; +table MailContact { + name: string; + email: string; +} + table Mail { uid:string; folder:string; - sender:string; - senderName:string; + sender:MailContact; + to:[MailContact]; + cc:[MailContact]; + bcc:[MailContact]; subject:string; date:string; unread:bool = false; -- cgit v1.2.3