mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 01:14:53 +01:00
notmuch-index-message: Don't index the "re:" prefix in subjects.
Getting closer to sup results all the time.
This commit is contained in:
parent
9bf3cda34c
commit
1479b99b50
1 changed files with 18 additions and 0 deletions
|
@ -187,6 +187,23 @@ add_terms_address_addrs (Xapian::Document doc,
|
|||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
skip_re_in_subject (const char *subject)
|
||||
{
|
||||
const char *s = subject;
|
||||
|
||||
while (*s) {
|
||||
while (*s && isspace (*s))
|
||||
s++;
|
||||
if (strncasecmp (s, "re:", 3) == 0)
|
||||
s += 3;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Generate terms for the body of a message, given the filename of the
|
||||
* message and the offset at which the headers of the message end,
|
||||
* (and hence the body begins). */
|
||||
|
@ -337,6 +354,7 @@ main (int argc, char **argv)
|
|||
gen_terms_address_names (term_gen, addresses, "to_name");
|
||||
|
||||
value = g_mime_message_get_subject (message);
|
||||
value = skip_re_in_subject (value);
|
||||
gen_terms (term_gen, "subject", value);
|
||||
gen_terms (term_gen, "body", value);
|
||||
|
||||
|
|
Loading…
Reference in a new issue