diff options
| author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2014-11-22 08:17:16 -0500 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2014-12-07 13:36:08 +0100 |
| commit | 4135a1f8dae02e712ff172ae38f68b74f9721236 (patch) | |
| tree | bec340eba47805e741260a53d675eefebe1b6cfd /lib | |
| parent | 6c1d626519b04fbc98a5c5497ec4fbcd76a51c00 (diff) | |
lib: Use email address instead of empty real name.
Currently, if a From-header is of the form:
"" <address@example.com>
the empty string will be treated as a valid real-name, and the entry
in the search results will be empty.
The new behavior here is that we treat an empty real-name field as if
it were null, so that the email address will be used in the search
results instead.
Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/thread.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/thread.cc b/lib/thread.cc index 8922403e..79c3e9bb 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -277,7 +277,8 @@ _thread_add_message (notmuch_thread_t *thread, address = internet_address_list_get_address (list, 0); if (address) { author = internet_address_get_name (address); - if (author == NULL) { + /* We treat quoted empty names as if they were empty. */ + if (author == NULL || author[0] == '\0') { InternetAddressMailbox *mailbox; mailbox = INTERNET_ADDRESS_MAILBOX (address); author = internet_address_mailbox_get_addr (mailbox); |
