summaryrefslogtreecommitdiffstats
path: root/common/mailpreprocessor.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-07 10:17:06 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-07 10:17:06 +0200
commitae7dbf2bda131fada11f1251dbedff1ed7129144 (patch)
treea9471c52642229ba715e51b399a34fe9cfd109fd /common/mailpreprocessor.cpp
parent90a8d33f7c17c802730fd9b978db0e32d28a7dff (diff)
downloadsink-ae7dbf2bda131fada11f1251dbedff1ed7129144.tar.gz
sink-ae7dbf2bda131fada11f1251dbedff1ed7129144.zip
Filter by sender
Diffstat (limited to 'common/mailpreprocessor.cpp')
-rw-r--r--common/mailpreprocessor.cpp19
1 files changed, 15 insertions, 4 deletions
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
133 } else { 133 } else {
134 contentToIndex << processPart(msg.data()); 134 contentToIndex << processPart(msg.data());
135 } 135 }
136 contentToIndex.append({{}, msg->from(true)->asUnicodeString()}); 136 const auto sender = mail.getSender();
137 contentToIndex.append({{}, msg->to(true)->asUnicodeString()}); 137 contentToIndex.append({{}, sender.name});
138 contentToIndex.append({{}, msg->cc(true)->asUnicodeString()}); 138 contentToIndex.append({{}, sender.emailAddress});
139 contentToIndex.append({{}, msg->bcc(true)->asUnicodeString()}); 139 for (const auto &c : mail.getTo()) {
140 contentToIndex.append({{}, c.name});
141 contentToIndex.append({{}, c.emailAddress});
142 }
143 for (const auto &c : mail.getCc()) {
144 contentToIndex.append({{}, c.name});
145 contentToIndex.append({{}, c.emailAddress});
146 }
147 for (const auto &c : mail.getBcc()) {
148 contentToIndex.append({{}, c.name});
149 contentToIndex.append({{}, c.emailAddress});
150 }
140 151
141 //Prepare content for indexing; 152 //Prepare content for indexing;
142 mail.setProperty("index", QVariant::fromValue(contentToIndex)); 153 mail.setProperty("index", QVariant::fromValue(contentToIndex));