summaryrefslogtreecommitdiffstats
path: root/common/domain/mail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain/mail.cpp')
-rw-r--r--common/domain/mail.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp
index 8abe259..c1b0b34 100644
--- a/common/domain/mail.cpp
+++ b/common/domain/mail.cpp
@@ -27,6 +27,7 @@
27#include "entitybuffer.h" 27#include "entitybuffer.h"
28#include "entity_generated.h" 28#include "entity_generated.h"
29#include "mail/threadindexer.h" 29#include "mail/threadindexer.h"
30#include "domainadaptor.h"
30 31
31#include "mail_generated.h" 32#include "mail_generated.h"
32 33
@@ -53,6 +54,15 @@ void TypeImplementation<Mail>::configure(TypeIndex &index)
53 index.addSecondaryProperty<Mail::ThreadId, Mail::MessageId>(); 54 index.addSecondaryProperty<Mail::ThreadId, Mail::MessageId>();
54} 55}
55 56
57void TypeImplementation<Mail>::configure(IndexPropertyMapper &indexPropertyMapper)
58{
59 indexPropertyMapper.addIndexLookupProperty<Mail::ThreadId>([](TypeIndex &index, const ApplicationDomain::BufferAdaptor &entity) {
60 auto messageId = entity.getProperty(Mail::MessageId::name);
61 auto thread = index.secondaryLookup<Mail::MessageId, Mail::ThreadId>(messageId);
62 Q_ASSERT(!thread.isEmpty());
63 return thread.first();
64 });
65}
56 66
57void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMapper) 67void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMapper)
58{ 68{