]> git.notmuchmail.org Git - notmuch/commit
Name thread based on matching msgs instead of first msg.
authorJesse Rosenthal <jrosenthal@jhu.edu>
Sat, 17 Apr 2010 17:59:22 +0000 (13:59 -0400)
committerCarl Worth <cworth@cworth.org>
Wed, 21 Apr 2010 21:56:53 +0000 (14:56 -0700)
commit4971b85641def6b17072ae1b0de0adf15d197f2c
tree66a6100c1c0b31d2e908ba4fcc37127335206b55
parent2186cac8e7bbc07c6aba0e1fbea91ca789814ecd
Name thread based on matching msgs instead of first msg.

At the moment all threads are named based on the name of the first message
in the thread. However, this can cause problems if people either start
new threads by replying-all (as unfortunately, many out there do) or
change the subject of their mails to reflect a shift in a thread on a
list.

This patch names threads based on (a) matches for the query, and (b) the
search order. If the search order is oldest-first (as in the default
inbox) it chooses the oldest matching message as the subject. If the
search order is newest-first it chooses the newest one.

Reply prefixes ("Re: ", "Aw: ", "Sv: ", "Vs: ") are ignored
(case-insensitively) so a Re: won't change the subject.

Note that this adds a "sort" argument to _notmuch_thread_create and
_thread_add_matched_message, so that when constructing the thread we can
be aware of the sort order.

Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
lib/notmuch-private.h
lib/query.cc
lib/thread.cc