mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 21:54:10 +01:00
Add label "attachment" when an attachment is seen.
This commit is contained in:
parent
870b398726
commit
7c9dbbad40
1 changed files with 8 additions and 0 deletions
|
@ -412,6 +412,7 @@ gen_terms_part (Xapian::TermGenerator term_gen,
|
||||||
GMimeStream *stream;
|
GMimeStream *stream;
|
||||||
GMimeDataWrapper *wrapper;
|
GMimeDataWrapper *wrapper;
|
||||||
GByteArray *byte_array;
|
GByteArray *byte_array;
|
||||||
|
GMimeContentDisposition *disposition;
|
||||||
char *body;
|
char *body;
|
||||||
|
|
||||||
if (GMIME_IS_MULTIPART (part)) {
|
if (GMIME_IS_MULTIPART (part)) {
|
||||||
|
@ -438,6 +439,13 @@ gen_terms_part (Xapian::TermGenerator term_gen,
|
||||||
return;
|
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 ();
|
byte_array = g_byte_array_new ();
|
||||||
|
|
||||||
stream = g_mime_stream_mem_new_with_byte_array (byte_array);
|
stream = g_mime_stream_mem_new_with_byte_array (byte_array);
|
||||||
|
|
Loading…
Reference in a new issue