aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/index.cc
diff options
context:
space:
mode:
authorGravatar Jameson Graef Rollins <jrollins@finestructure.net>2011-05-25 18:01:20 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-05-27 16:22:00 -0700
commit1d6b49561f50d6cde1b473f9887e37748e49c02c (patch)
tree8d2f86fabdffdb2577ed6de7398a0824d83eeaba /lib/index.cc
parent45fe3547458e0c403f7501bad89860afe2fa534a (diff)
tag signed/encrypted during notmuch new
This patch adds the tag "signed" to messages with any multipart/signed parts, and the tag "encrypted" to messages with any multipart/encrypted parts. This only occurs when messages are indexed during notmuch new, so a database rebuild is required to have old messages tagged.
Diffstat (limited to 'lib/index.cc')
-rw-r--r--lib/index.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/index.cc b/lib/index.cc
index bdfb8ed5..e8e9922b 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -325,6 +325,12 @@ _index_mime_part (notmuch_message_t *message,
GMimeMultipart *multipart = GMIME_MULTIPART (part);
int i;
+ if (GMIME_IS_MULTIPART_SIGNED (multipart))
+ _notmuch_message_add_term (message, "tag", "signed");
+
+ if (GMIME_IS_MULTIPART_ENCRYPTED (multipart))
+ _notmuch_message_add_term (message, "tag", "encrypted");
+
for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {
if (GMIME_IS_MULTIPART_SIGNED (multipart)) {
/* Don't index the signature. */