summaryrefslogtreecommitdiffstats
path: root/common/domain/mail.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-20 00:17:00 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-20 00:17:00 +0100
commit44e3e7c5312e232c35403b5f8ad7cae0b4e6ddee (patch)
treea4902d07e465617a53a56f00aff66f4977964f9e /common/domain/mail.cpp
parente6820f5b59a3d9615863740bb16cec150206e326 (diff)
downloadsink-44e3e7c5312e232c35403b5f8ad7cae0b4e6ddee.tar.gz
sink-44e3e7c5312e232c35403b5f8ad7cae0b4e6ddee.zip
Fix threading for non-threaded messages.
Ensure we always have a messageId to work with, and avoid grouping all non-threaded messages together.
Diffstat (limited to 'common/domain/mail.cpp')
-rw-r--r--common/domain/mail.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp
index 6926711..3dd9093 100644
--- a/common/domain/mail.cpp
+++ b/common/domain/mail.cpp
@@ -59,8 +59,10 @@ void TypeImplementation<Mail>::configure(IndexPropertyMapper &indexPropertyMappe
59 indexPropertyMapper.addIndexLookupProperty<Mail::ThreadId>([](TypeIndex &index, const ApplicationDomain::BufferAdaptor &entity) { 59 indexPropertyMapper.addIndexLookupProperty<Mail::ThreadId>([](TypeIndex &index, const ApplicationDomain::BufferAdaptor &entity) {
60 auto messageId = entity.getProperty(Mail::MessageId::name); 60 auto messageId = entity.getProperty(Mail::MessageId::name);
61 auto thread = index.secondaryLookup<Mail::MessageId, Mail::ThreadId>(messageId); 61 auto thread = index.secondaryLookup<Mail::MessageId, Mail::ThreadId>(messageId);
62 Q_ASSERT(!thread.isEmpty()); 62 if (!thread.isEmpty()) {
63 return thread.first(); 63 return thread.first();
64 }
65 return QByteArray{};
64 }); 66 });
65} 67}
66 68