Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id ECC1B431FC3 for ; Fri, 21 Nov 2014 07:58:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m1qcvZvwfPZi for ; Fri, 21 Nov 2014 07:57:59 -0800 (PST) Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu [162.129.8.201]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 89342431FBC for ; Fri, 21 Nov 2014 07:57:55 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.07,432,1413259200"; d="scan'208";a="424886169" Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234]) by IPEB4.johnshopkins.edu with ESMTP/TLS/AES128-SHA; 21 Nov 2014 10:57:55 -0500 From: Jesse Rosenthal To: notmuch@notmuchmail.org Subject: [PATCH v2 1/2] lib: Use email address instead of empty real name. Date: Fri, 21 Nov 2014 10:57:41 -0500 Message-Id: <1416585462-24558-2-git-send-email-jrosenthal@jhu.edu> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu> References: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 15:58:07 -0000 Currently, if a From-header is of the form: "" 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 --- 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. + if (author == NULL || author[0]=='\0' ) { InternetAddressMailbox *mailbox; mailbox = INTERNET_ADDRESS_MAILBOX (address); author = internet_address_mailbox_get_addr (mailbox); -- 2.1.3