From f03005ccc2cd0f7eea3ad8e7e1c90ed2d8ea3561 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 6 Mar 2017 15:10:05 +0100 Subject: Avoid threading messages by thread with empty subject --- common/mail/threadindexer.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'common/mail') 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 thread = index().secondaryLookup(parentMessageId); SinkTrace() << "Found parent: " << thread; } + if (thread.isEmpty()) { - //Try to lookup the thread by subject: - thread = index().secondaryLookup(normalizedSubject); + //Try to lookup the thread by subject if not empty + if ( !normalizedSubject.isEmpty()) { + thread = index().secondaryLookup(normalizedSubject); + } if (thread.isEmpty()) { thread << QUuid::createUuid().toByteArray(); SinkTrace() << "Created a new thread: " << thread; @@ -121,7 +124,9 @@ void ThreadIndexer::updateThreadingIndex(const QByteArray &identifier, const App } index().index(messageId, thread.first(), transaction); index().index(thread.first(), messageId, transaction); - index().index(normalizedSubject, thread.first(), transaction); + if (!normalizedSubject.isEmpty()) { + index().index(normalizedSubject, thread.first(), transaction); + } } -- cgit v1.2.3