[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / a5 / 9f6a4e6536354fa23ebec99799a43dc68adc3f
1 Return-Path: <amthrax@drake.mit.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 DB978431FAF\r
6         for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 16:26:37 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 d6AMw5XZ7hBb for <notmuch@notmuchmail.org>;\r
16         Sun, 19 Feb 2012 16:26:36 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
18         [18.9.25.15])\r
19         by olra.theworths.org (Postfix) with ESMTP id 455AA431FAE\r
20         for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 16:26:36 -0800 (PST)\r
21 X-AuditID: 1209190f-b7f8a6d000000914-58-4f41933b1097\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 0E.84.02324.B33914F4; Sun, 19 Feb 2012 19:26:35 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q1K0QZRr024835; \r
27         Sun, 19 Feb 2012 19:26:35 -0500\r
28 Received: from drake.mit.edu\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1K0QXd3000301\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sun, 19 Feb 2012 19:26:34 -0500 (EST)\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
36         (envelope-from <amthrax@drake.mit.edu>)\r
37         id 1RzH5N-0001yI-GQ; Sun, 19 Feb 2012 19:26:33 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v2 3/8] show: Use consistent header ordering in the JSON\r
41  format\r
42 Date: Sun, 19 Feb 2012 19:26:25 -0500\r
43 Message-Id: <1329697590-7404-4-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.7.3\r
45 In-Reply-To: <1329697590-7404-1-git-send-email-amdragon@mit.edu>\r
46 References: <1329240823-7856-1-git-send-email-amdragon@mit.edu>\r
47         <1329697590-7404-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixCmqrWs92dHf4MR7Y4vrN2cyW7xZOY/V\r
50         gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4Mr4cMin4JlmxfLli1gbGD8odzFyckgImEjM\r
51         3HCREcIWk7hwbz1bFyMXh5DAPkaJzh8/mCGcDYwSd/ZtYIdw7jNJHD/wlhHCmc8oce/wH7B+\r
52         NgENiW37l4PZIgLSEjvvzmYFsZkFrCQOX90EZgsL+EscXbAWzGYRUJX4vGAdkM3BwStgL3H0\r
53         nwPEGQoS51afYwcJcwo4SKze4QoSFhIolTjyZAvTBEb+BYwMqxhlU3KrdHMTM3OKU5N1i5MT\r
54         8/JSi3RN9HIzS/RSU0o3MYLDSJJ/B+O3g0qHGAU4GJV4eKXKHPyFWBPLiitzDzFKcjApifKe\r
55         muDoL8SXlJ9SmZFYnBFfVJqTWnyIUYKDWUmEd4E9UI43JbGyKrUoHyYlzcGiJM6rpvXOT0gg\r
56         PbEkNTs1tSC1CCYrw8GhJMHbMAmoUbAoNT21Ii0zpwQhzcTBCTKcB2i4IkgNb3FBYm5xZjpE\r
57         /hSjopQ4rw1IQgAkkVGaB9cLi/NXjOJArwjzpoFU8QBTBFz3K6DBTECDeYXsQAaXJCKkpBoY\r
58         fY++d/sxuX/K8pbtm3Y3si9X8X1hvfE2q2/l1FkMyav3Ox09vLNw2fq+1iauxAbOJXPLovSP\r
59         ta68fH7bq9tTC36UaE1umHeOMUbqeYzpEf5Lt1KWdtec3jbrffOFKXZRd55bTP5j4rD8yrWt\r
60         jQvOOfxiCWKatuDU2pCTGw523zOcoHMnV7VfxliJpTgj0VCLuag4EQAR+q+zzgIAAA==\r
61 Cc: tomi.ollila@iki.fi\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Mon, 20 Feb 2012 00:26:38 -0000\r
75 \r
76 Previously, top-level message headers were printed as Subject, From,\r
77 To, Date, while embedded message headers were printed From, To,\r
78 Subject, Date.  This makes both cases use the former order and updates\r
79 the tests accordingly.\r
80 ---\r
81  notmuch-show.c |    6 +++---\r
82  test/multipart |    8 ++++----\r
83  2 files changed, 7 insertions(+), 7 deletions(-)\r
84 \r
85 diff --git a/notmuch-show.c b/notmuch-show.c\r
86 index 868b2cd..9ca9882 100644\r
87 --- a/notmuch-show.c\r
88 +++ b/notmuch-show.c\r
89 @@ -328,6 +328,9 @@ format_headers_message_part_json (GMimeMessage *message)\r
90      const char *recipients_string;\r
91  \r
92      printf ("%s: %s",\r
93 +           json_quote_str (ctx_quote, "Subject"),\r
94 +           json_quote_str (ctx_quote, g_mime_message_get_subject (message)));\r
95 +    printf (", %s: %s",\r
96             json_quote_str (ctx_quote, "From"),\r
97             json_quote_str (ctx_quote, g_mime_message_get_sender (message)));\r
98      recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);\r
99 @@ -343,9 +346,6 @@ format_headers_message_part_json (GMimeMessage *message)\r
100                 json_quote_str (ctx_quote, "Cc"),\r
101                 json_quote_str (ctx_quote, recipients_string));\r
102      printf (", %s: %s",\r
103 -           json_quote_str (ctx_quote, "Subject"),\r
104 -           json_quote_str (ctx_quote, g_mime_message_get_subject (message)));\r
105 -    printf (", %s: %s",\r
106             json_quote_str (ctx_quote, "Date"),\r
107             json_quote_str (ctx_quote, g_mime_message_get_date_as_string (message)));\r
108  \r
109 diff --git a/test/multipart b/test/multipart\r
110 index 2dd73f5..4d14804 100755\r
111 --- a/test/multipart\r
112 +++ b/test/multipart\r
113 @@ -325,7 +325,7 @@ cat <<EOF >EXPECTED\r
114  {"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [\r
115  {"id": 1, "content-type": "multipart/signed", "content": [\r
116  {"id": 2, "content-type": "multipart/mixed", "content": [\r
117 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
118 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
119  {"id": 4, "content-type": "multipart/alternative", "content": [\r
120  {"id": 5, "content-type": "text/html"}, \r
121  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
122 @@ -342,7 +342,7 @@ cat <<EOF >EXPECTED\r
123  \r
124  {"id": 1, "content-type": "multipart/signed", "content": [\r
125  {"id": 2, "content-type": "multipart/mixed", "content": [\r
126 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
127 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
128  {"id": 4, "content-type": "multipart/alternative", "content": [\r
129  {"id": 5, "content-type": "text/html"}, \r
130  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
131 @@ -358,7 +358,7 @@ echo >>OUTPUT # expect *no* newline at end of output\r
132  cat <<EOF >EXPECTED\r
133  \r
134  {"id": 2, "content-type": "multipart/mixed", "content": [\r
135 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
136 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
137  {"id": 4, "content-type": "multipart/alternative", "content": [\r
138  {"id": 5, "content-type": "text/html"}, \r
139  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, \r
140 @@ -372,7 +372,7 @@ notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | s\r
141  echo >>OUTPUT # expect *no* newline at end of output\r
142  cat <<EOF >EXPECTED\r
143  \r
144 -{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Subject": "html message", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
145 +{"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [\r
146  {"id": 4, "content-type": "multipart/alternative", "content": [\r
147  {"id": 5, "content-type": "text/html"}, \r
148  {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}\r
149 -- \r
150 1.7.7.3\r
151 \r