]> git.notmuchmail.org Git - notmuch/commitdiff
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)
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>

No differences found