From ae7dbf2bda131fada11f1251dbedff1ed7129144 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 7 May 2018 10:17:06 +0200 Subject: Filter by sender --- common/mailpreprocessor.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'common/mailpreprocessor.cpp') diff --git a/common/mailpreprocessor.cpp b/common/mailpreprocessor.cpp index 58cb15b..9efa5c9 100644 --- a/common/mailpreprocessor.cpp +++ b/common/mailpreprocessor.cpp @@ -133,10 +133,21 @@ void MailPropertyExtractor::updatedIndexedProperties(Sink::ApplicationDomain::Ma } else { contentToIndex << processPart(msg.data()); } - contentToIndex.append({{}, msg->from(true)->asUnicodeString()}); - contentToIndex.append({{}, msg->to(true)->asUnicodeString()}); - contentToIndex.append({{}, msg->cc(true)->asUnicodeString()}); - contentToIndex.append({{}, msg->bcc(true)->asUnicodeString()}); + const auto sender = mail.getSender(); + contentToIndex.append({{}, sender.name}); + contentToIndex.append({{}, sender.emailAddress}); + for (const auto &c : mail.getTo()) { + contentToIndex.append({{}, c.name}); + contentToIndex.append({{}, c.emailAddress}); + } + for (const auto &c : mail.getCc()) { + contentToIndex.append({{}, c.name}); + contentToIndex.append({{}, c.emailAddress}); + } + for (const auto &c : mail.getBcc()) { + contentToIndex.append({{}, c.name}); + contentToIndex.append({{}, c.emailAddress}); + } //Prepare content for indexing; mail.setProperty("index", QVariant::fromValue(contentToIndex)); -- cgit v1.2.3