mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
Index an attachment's filename extension as well.
I hadn't realized that sup used a special term for this. But there you go.
This commit is contained in:
parent
29974af08f
commit
30ed705fda
1 changed files with 13 additions and 2 deletions
|
@ -443,9 +443,20 @@ gen_terms_part (Xapian::TermGenerator term_gen,
|
|||
if (disposition &&
|
||||
strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
|
||||
{
|
||||
const char *filename = g_mime_part_get_filename (GMIME_PART (part));
|
||||
const char *extension;
|
||||
|
||||
add_term (term_gen.get_document (), "label", "attachment");
|
||||
gen_terms (term_gen, "attachment",
|
||||
g_mime_part_get_filename (GMIME_PART (part)));
|
||||
gen_terms (term_gen, "attachment", filename);
|
||||
|
||||
if (filename) {
|
||||
extension = strchr (filename, '.');
|
||||
if (extension) {
|
||||
add_term (term_gen.get_document (), "attachment_extension",
|
||||
extension + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue