summaryrefslogtreecommitdiffstats
path: root/common/mail/threadindexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/mail/threadindexer.cpp')
-rw-r--r--common/mail/threadindexer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/mail/threadindexer.cpp b/common/mail/threadindexer.cpp
index 6f2933c..d91ab5f 100644
--- a/common/mail/threadindexer.cpp
+++ b/common/mail/threadindexer.cpp
@@ -101,9 +101,12 @@ void ThreadIndexer::updateThreadingIndex(const QByteArray &identifier, const App
101 thread = index().secondaryLookup<Mail::MessageId, Mail::ThreadId>(parentMessageId); 101 thread = index().secondaryLookup<Mail::MessageId, Mail::ThreadId>(parentMessageId);
102 SinkTrace() << "Found parent: " << thread; 102 SinkTrace() << "Found parent: " << thread;
103 } 103 }
104
104 if (thread.isEmpty()) { 105 if (thread.isEmpty()) {
105 //Try to lookup the thread by subject: 106 //Try to lookup the thread by subject if not empty
106 thread = index().secondaryLookup<Mail::Subject, Mail::ThreadId>(normalizedSubject); 107 if ( !normalizedSubject.isEmpty()) {
108 thread = index().secondaryLookup<Mail::Subject, Mail::ThreadId>(normalizedSubject);
109 }
107 if (thread.isEmpty()) { 110 if (thread.isEmpty()) {
108 thread << QUuid::createUuid().toByteArray(); 111 thread << QUuid::createUuid().toByteArray();
109 SinkTrace() << "Created a new thread: " << thread; 112 SinkTrace() << "Created a new thread: " << thread;
@@ -121,7 +124,9 @@ void ThreadIndexer::updateThreadingIndex(const QByteArray &identifier, const App
121 } 124 }
122 index().index<Mail::MessageId, Mail::ThreadId>(messageId, thread.first(), transaction); 125 index().index<Mail::MessageId, Mail::ThreadId>(messageId, thread.first(), transaction);
123 index().index<Mail::ThreadId, Mail::MessageId>(thread.first(), messageId, transaction); 126 index().index<Mail::ThreadId, Mail::MessageId>(thread.first(), messageId, transaction);
124 index().index<Mail::Subject, Mail::ThreadId>(normalizedSubject, thread.first(), transaction); 127 if (!normalizedSubject.isEmpty()) {
128 index().index<Mail::Subject, Mail::ThreadId>(normalizedSubject, thread.first(), transaction);
129 }
125} 130}
126 131
127 132