[PATCH 3/3] emacs: Handle switch-function argument of notmuch-mua-mail
[notmuch-archives.git] / 26 / c1cd6b0ce761312e67b134048ca2a44e7b8fdb
1 Return-Path: <prvs=395835c76=jrosenthal@jhu.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id ECC1B431FC3\r
6         for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:58:06 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id m1qcvZvwfPZi for <notmuch@notmuchmail.org>;\r
16         Fri, 21 Nov 2014 07:57:59 -0800 (PST)\r
17 Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu\r
18         [162.129.8.201]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 89342431FBC\r
21         for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:57:55 -0800 (PST)\r
22 X-IronPort-AV: E=Sophos;i="5.07,432,1413259200"; d="scan'208";a="424886169"\r
23 Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234])\r
24         by IPEB4.johnshopkins.edu with ESMTP/TLS/AES128-SHA;\r
25         21 Nov 2014 10:57:55 -0500\r
26 From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH v2 1/2] lib: Use email address instead of empty real name.\r
29 Date: Fri, 21 Nov 2014 10:57:41 -0500\r
30 Message-Id: <1416585462-24558-2-git-send-email-jrosenthal@jhu.edu>\r
31 X-Mailer: git-send-email 2.1.3\r
32 In-Reply-To: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu>\r
33 References: <1416585462-24558-1-git-send-email-jrosenthal@jhu.edu>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Fri, 21 Nov 2014 15:58:07 -0000\r
47 \r
48 Currently, if a From-header is of the form:\r
49 \r
50     "" <address@example.com>\r
51 \r
52 the empty string will be treated as a valid real-name, and the entry\r
53 in the search results will be empty.\r
54 \r
55 The new behavior here is that we treat an empty real-name field as if\r
56 it were null, so that the email address will be used in the search\r
57 results instead.\r
58 \r
59 Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>\r
60 ---\r
61  lib/thread.cc | 3 ++-\r
62  1 file changed, 2 insertions(+), 1 deletion(-)\r
63 \r
64 diff --git a/lib/thread.cc b/lib/thread.cc\r
65 index 8922403..68b2b94 100644\r
66 --- a/lib/thread.cc\r
67 +++ b/lib/thread.cc\r
68 @@ -277,7 +277,8 @@ _thread_add_message (notmuch_thread_t *thread,\r
69         address = internet_address_list_get_address (list, 0);\r
70         if (address) {\r
71             author = internet_address_get_name (address);\r
72 -           if (author == NULL) {\r
73 +           // We treat quoted empty names as if they were empty.\r
74 +           if (author == NULL || author[0]=='\0' ) {\r
75                 InternetAddressMailbox *mailbox;\r
76                 mailbox = INTERNET_ADDRESS_MAILBOX (address);\r
77                 author = internet_address_mailbox_get_addr (mailbox);\r
78 -- \r
79 2.1.3\r
80 \r