lib: enforce that n_message_reindex takes headers from first file

This is still a bit stopgap to be only choosing one set of headers,
but this seems like a more defensible set of headers to choose.
This commit is contained in:
David Bremner 2017-08-27 20:58:22 -03:00
parent 36a3d65034
commit debfae20db
2 changed files with 3 additions and 2 deletions

View file

@ -2034,7 +2034,9 @@ notmuch_message_reindex (notmuch_message_t *message,
thread_id = orig_thread_id; thread_id = orig_thread_id;
_notmuch_message_add_term (message, "thread", thread_id); _notmuch_message_add_term (message, "thread", thread_id);
_notmuch_message_set_header_values (message, date, from, subject); /* Take header values only from first filename */
if (found == 0)
_notmuch_message_set_header_values (message, date, from, subject);
ret = _notmuch_message_index_file (message, message_file); ret = _notmuch_message_index_file (message, message_file);

View file

@ -41,7 +41,6 @@ notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT
test_expect_equal_file EXPECTED OUTPUT test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest 'reindex choses subject from first filename' test_begin_subtest 'reindex choses subject from first filename'
test_subtest_known_broken
cat <<EOF > EXPECTED cat <<EOF > EXPECTED
thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 0 (inbox unread) thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 0 (inbox unread)
EOF EOF