diff options
| author | Carl Worth <cworth@cworth.org> | 2009-10-14 16:18:17 -0700 |
|---|---|---|
| committer | Carl Worth <cworth@cworth.org> | 2009-10-14 16:20:26 -0700 |
| commit | 7c9dbbad40e4dfb2bf412c36938771a2e93a984c (patch) | |
| tree | 6720b4c6b1bee3243f64348b0b6e417ed1d36b4a | |
| parent | 870b3987265f74ed8b45ba0e7d7edfcca1923b5a (diff) | |
Add label "attachment" when an attachment is seen.
| -rw-r--r-- | notmuch-index-message.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/notmuch-index-message.cc b/notmuch-index-message.cc index 5396cd19..2d0bfc28 100644 --- a/notmuch-index-message.cc +++ b/notmuch-index-message.cc @@ -412,6 +412,7 @@ gen_terms_part (Xapian::TermGenerator term_gen, GMimeStream *stream; GMimeDataWrapper *wrapper; GByteArray *byte_array; + GMimeContentDisposition *disposition; char *body; if (GMIME_IS_MULTIPART (part)) { @@ -438,6 +439,13 @@ gen_terms_part (Xapian::TermGenerator term_gen, return; } + disposition = g_mime_object_get_content_disposition (GMIME_OBJECT (part)); + if (disposition && + strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) + { + add_term (term_gen.get_document (), "label", "attachment"); + } + byte_array = g_byte_array_new (); stream = g_mime_stream_mem_new_with_byte_array (byte_array); |
