]> rtime.felk.cvut.cz Git - notmuch.git/commit
thread.cc: Avoid empty thread names if possible.
authorJesse Rosenthal <jrosenthal@jhu.edu>
Wed, 29 Oct 2014 20:51:43 +0000 (16:51 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 17 Jan 2015 12:48:26 +0000 (13:48 +0100)
commit67e368ac7ba84b0ea70356c2bdb3a14018009294
tree990d7d5595381d2da644b7969b4055d59d6c045b
parent71fb37d48236e49b64e300c3764c0e17e02c8f9e
thread.cc: Avoid empty thread names if possible.

Currently the thread is named based on either the oldest or newest
matching message (depending on the search order). If this message has
an empty subject, though, the thread will show up with an empty
subject in the search results. (See the thread starting with
`id:1412371140-21051-1-git-send-email-david@tethera.net` for an
example.)

This changes the behavior so it will use a non-empty name for the
thread if possible. We name threads based on (a) non-empty 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
non-empty message as the subject. If the search order is newest-first
it chooses the newest one.
lib/thread.cc