[PATCH v2 1/2] lib: Use email address instead of empty real name.

Jani Nikula jani at nikula.org
Sat Nov 22 03:29:38 PST 2014


On Fri, 21 Nov 2014, Jesse Rosenthal <jrosenthal at jhu.edu> wrote:
> Currently, if a From-header is of the form:
>
>     "" <address at 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.

Makes sense.

> Signed-off-by: Jesse Rosenthal <jrosenthal at jhu.edu>
> ---
>  lib/thread.cc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/thread.cc b/lib/thread.cc
> index 8922403..68b2b94 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.

Nitpick, we don't use // style comments.

> +	    if (author == NULL || author[0]=='\0' ) {

Nitpick, please add spaces around "==" but no space before closing ")".


BR,
Jani.

>  		InternetAddressMailbox *mailbox;
>  		mailbox = INTERNET_ADDRESS_MAILBOX (address);
>  		author = internet_address_mailbox_get_addr (mailbox);
> -- 
> 2.1.3
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list