[PATCH v2 1/2] lib: Use email address instead of empty real name.
authorJesse Rosenthal <jrosenthal@jhu.edu>
Fri, 21 Nov 2014 15:57:41 +0000 (10:57 +1900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:48 +0000 (14:46 -0700)
26/c1cd6b0ce761312e67b134048ca2a44e7b8fdb [new file with mode: 0644]

diff --git a/26/c1cd6b0ce761312e67b134048ca2a44e7b8fdb b/26/c1cd6b0ce761312e67b134048ca2a44e7b8fdb
new file mode 100644 (file)
index 0000000..789f5eb
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <prvs=395835c76=jrosenthal@jhu.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id ECC1B431FC3\r
+       for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:58:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id m1qcvZvwfPZi for <notmuch@notmuchmail.org>;\r
+       Fri, 21 Nov 2014 07:57:59 -0800 (PST)\r
+Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu\r
+       [162.129.8.201]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 89342431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:57:55 -0800 (PST)\r
+X-IronPort-AV: E=Sophos;i="5.07,432,1413259200"; d="scan'208";a="424886169"\r
+Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234])\r
+       by IPEB4.johnshopkins.edu with ESMTP/TLS/AES128-SHA;\r
+       21 Nov 2014 10:57:55 -0500\r
+From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/2] lib: Use email address instead of empty real name.\r
+Date: Fri, 21 Nov 2014 10:57:41 -0500\r
+Message-Id: <1416585462-24558-2-git-send-email-jrosenthal@jhu.edu>\r
+X-Mailer: git-send-email 2.1.3\r
+In-Reply-To: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu>\r
+References: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 21 Nov 2014 15:58:07 -0000\r
+\r
+Currently, if a From-header is of the form:\r
+\r
+    "" <address@example.com>\r
+\r
+the empty string will be treated as a valid real-name, and the entry\r
+in the search results will be empty.\r
+\r
+The new behavior here is that we treat an empty real-name field as if\r
+it were null, so that the email address will be used in the search\r
+results instead.\r
+\r
+Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>\r
+---\r
+ lib/thread.cc | 3 ++-\r
+ 1 file changed, 2 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/lib/thread.cc b/lib/thread.cc\r
+index 8922403..68b2b94 100644\r
+--- a/lib/thread.cc\r
++++ b/lib/thread.cc\r
+@@ -277,7 +277,8 @@ _thread_add_message (notmuch_thread_t *thread,\r
+       address = internet_address_list_get_address (list, 0);\r
+       if (address) {\r
+           author = internet_address_get_name (address);\r
+-          if (author == NULL) {\r
++          // We treat quoted empty names as if they were empty.\r
++          if (author == NULL || author[0]=='\0' ) {\r
+               InternetAddressMailbox *mailbox;\r
+               mailbox = INTERNET_ADDRESS_MAILBOX (address);\r
+               author = internet_address_mailbox_get_addr (mailbox);\r
+-- \r
+2.1.3\r
+\r