mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-18 21:45:17 +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 &&
|
if (disposition &&
|
||||||
strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
|
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");
|
add_term (term_gen.get_document (), "label", "attachment");
|
||||||
gen_terms (term_gen, "attachment",
|
gen_terms (term_gen, "attachment", filename);
|
||||||
g_mime_part_get_filename (GMIME_PART (part)));
|
|
||||||
|
if (filename) {
|
||||||
|
extension = strchr (filename, '.');
|
||||||
|
if (extension) {
|
||||||
|
add_term (term_gen.get_document (), "attachment_extension",
|
||||||
|
extension + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue