From 1d6b49561f50d6cde1b473f9887e37748e49c02c Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Wed, 25 May 2011 18:01:20 -0700 Subject: 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. --- lib/index.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') 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. */ -- cgit v1.2.3