database error
[notmuch-archives.git] / 32 / 48a5d19abfb69be90efeb60daa75f1760c428d
1 Return-Path: <jani@nikula.org>\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 3EF51431E84\r
6         for <notmuch@notmuchmail.org>; Sun, 12 Jan 2014 07:31:47 -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 wQ2HW6eUSwgx for <notmuch@notmuchmail.org>;\r
16         Sun, 12 Jan 2014 07:31:39 -0800 (PST)\r
17 Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com\r
18  [74.125.83.46])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  46815431FAE    for <notmuch@notmuchmail.org>; Sun, 12 Jan 2014 07:31:39 -0800\r
21  (PST)\r
22 Received: by mail-ee0-f46.google.com with SMTP id d49so2717706eek.33\r
23         for <notmuch@notmuchmail.org>; Sun, 12 Jan 2014 07:31:36 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:subject:in-reply-to:references\r
27         :user-agent:date:message-id:mime-version:content-type;\r
28         bh=3DWeqNY4j2Iv7/PRSIMt4miWpI2bN2eusfR7Rhmahc4=;\r
29         b=CxIOebTk5zz5Ruorv24Qwc2yhYv5ynaVYh13QGKeJl0W47lFZYhUkJnOZ+aE1teZVu\r
30         xpRzxoIul4aqZ0OM0oerV+HMQ4bw1tJ+G+r7q6CC7PsuaGnNKpqeoMdnt3PTQu5JKdWx\r
31         eJXlVHU54IVA0nVBeeRvZ6Q4iA2mpIuUeXSEpUe4xJjsYTxkBkJnnPgOboj1IoAe2JFx\r
32         CP6ItONswvyPqggKdLgEstP16ta+b9vqq4pZcRk75hhWYwrLnDCRf5fa8lnjc3HU3uYX\r
33         1FIvbgW04vJORCm6fjVK70BWgesdN5fEHZ2HpZrmJHDsgpsKfJmbfuGNO/9vEOv44FJ5\r
34         20uQ==\r
35 X-Gm-Message-State:\r
36  ALoCoQmH5Mi8TaNXE3vQleQ258wOxfHa3S/7KKvaKZh0DTFZlXaIKdBN5X9PeV9Ou3fg55W81kXg\r
37 X-Received: by 10.14.53.65 with SMTP id f41mr3482481eec.105.1389540695329;\r
38         Sun, 12 Jan 2014 07:31:35 -0800 (PST)\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
40         [88.195.111.91])\r
41         by mx.google.com with ESMTPSA id l4sm31869006een.13.2014.01.12.07.31.33\r
42         for <multiple recipients>\r
43         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
44         Sun, 12 Jan 2014 07:31:34 -0800 (PST)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: Peter Wang <novalazy@gmail.com>, notmuch@notmuchmail.org\r
47 Subject: Re: [PATCH] show: add In-reply-to,\r
48         References fields to structured formats\r
49 In-Reply-To: <1389502800-9237-1-git-send-email-novalazy@gmail.com>\r
50 References: <1389502800-9237-1-git-send-email-novalazy@gmail.com>\r
51 User-Agent: Notmuch/0.17~rc2+18~g39a67a6 (http://notmuchmail.org) Emacs/24.3.1\r
52         (x86_64-pc-linux-gnu)\r
53 Date: Sun, 12 Jan 2014 17:31:32 +0200\r
54 Message-ID: <878uulush7.fsf@nikula.org>\r
55 MIME-Version: 1.0\r
56 Content-Type: text/plain\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sun, 12 Jan 2014 15:31:47 -0000\r
70 \r
71 On Sun, 12 Jan 2014, Peter Wang <novalazy@gmail.com> wrote:\r
72 > This is useful when 'show' is used to retrieve a draft message\r
73 > which is in reply to another message.\r
74 \r
75 I'd like to know more about *how* this is useful. Indeed the whole big\r
76 picture about supporting draft or postponed messages is foggy. I would\r
77 like to have some clarity about that first.\r
78 \r
79 Apparently the idea is to index draft messages. How do you save them?\r
80 What guarantees are there that they look enough like real messages that\r
81 they get indexed? Does this patch mean that the idea is to resume draft\r
82 messages using the structured formats instead of opening the raw file?\r
83 Why?  What do you plan to do with the saved draft? And so on...\r
84 \r
85 BR,\r
86 Jani.\r
87 \r
88 > ---\r
89 >  devel/schemata      |  9 ++++++++-\r
90 >  notmuch-show.c      | 16 ++++++++++++----\r
91 >  test/thread-replies |  7 +++++++\r
92 >  3 files changed, 27 insertions(+), 5 deletions(-)\r
93 >\r
94 > diff --git a/devel/schemata b/devel/schemata\r
95 > index 41dc4a6..dd41217 100644\r
96 > --- a/devel/schemata\r
97 > +++ b/devel/schemata\r
98 > @@ -14,7 +14,7 @@ are interleaved. Keys are printed as keywords (symbols preceded by a\r
99 >  colon), e.g. (:id "123" :time 54321 :from "foobar"). Null is printed as\r
100 >  nil, true as t and false as nil.\r
101 >  \r
102 > -This is version 2 of the structured output format.\r
103 > +This is version 3 of the structured output format.\r
104 >  \r
105 >  Version history\r
106 >  ---------------\r
107 > @@ -26,6 +26,9 @@ v1\r
108 >  v2\r
109 >  - Added the thread_summary.query field.\r
110 >  \r
111 > +v3\r
112 > +- Added headers.in-reply-to and headers.references fields.\r
113 > +\r
114 >  Common non-terminals\r
115 >  --------------------\r
116 >  \r
117 > @@ -105,6 +108,10 @@ headers = {\r
118 >      Cc?:            string,\r
119 >      Bcc?:           string,\r
120 >      Reply-To?:      string,\r
121 > +    # Added in schema version 3.\r
122 > +    In-reply-to?:   string,\r
123 > +    # Added in schema version 3.\r
124 > +    References?:    string,\r
125 >      Date:           string\r
126 >  }\r
127 >  \r
128 > diff --git a/notmuch-show.c b/notmuch-show.c\r
129 > index c07f887..774ba44 100644\r
130 > --- a/notmuch-show.c\r
131 > +++ b/notmuch-show.c\r
132 > @@ -222,6 +222,8 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,\r
133 >      InternetAddressList *recipients;\r
134 >      const char *recipients_string;\r
135 >      const char *reply_to_string;\r
136 > +    const char *in_reply_to_string;\r
137 > +    const char *references_string;\r
138 >  \r
139 >      sp->begin_map (sp);\r
140 >  \r
141 > @@ -258,13 +260,19 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,\r
142 >       sp->string (sp, reply_to_string);\r
143 >      }\r
144 >  \r
145 > -    if (reply) {\r
146 > +    in_reply_to_string = g_mime_object_get_header (GMIME_OBJECT (message), "In-reply-to");\r
147 > +    if (in_reply_to_string || reply) {\r
148 >       sp->map_key (sp, "In-reply-to");\r
149 > -     sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), "In-reply-to"));\r
150 > +     sp->string (sp, in_reply_to_string);\r
151 > +    }\r
152 >  \r
153 > +    references_string = g_mime_object_get_header (GMIME_OBJECT (message), "References");\r
154 > +    if (references_string || reply) {\r
155 >       sp->map_key (sp, "References");\r
156 > -     sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), "References"));\r
157 > -    } else {\r
158 > +     sp->string (sp, references_string);\r
159 > +    }\r
160 > +\r
161 > +    if (! reply) {\r
162 >       sp->map_key (sp, "Date");\r
163 >       sp->string (sp, g_mime_message_get_date_as_string (message));\r
164 >      }\r
165 > diff --git a/test/thread-replies b/test/thread-replies\r
166 > index eeb70d0..9d4b379 100755\r
167 > --- a/test/thread-replies\r
168 > +++ b/test/thread-replies\r
169 > @@ -39,6 +39,8 @@ expected='[[[{"id": "foo@one.com",\r
170 >   "tags": ["inbox", "unread"], "headers": {"Subject": "Re: one",\r
171 >   "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
172 >   "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
173 > + "In-reply-to": "mumble",\r
174 > + "References": "<foo@one.com>",\r
175 >   "Date": "Fri, 05 Jan 2001 15:43:57 +0000"},\r
176 >   "body": [{"id": 1, "content-type": "text/plain",\r
177 >   "content": "This is just a test message (#2)\n"}]}, []]]]]]'\r
178 > @@ -68,6 +70,8 @@ expected='[[[{"id": "foo@two.com",\r
179 >   "headers": {"Subject": "Re: two",\r
180 >   "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
181 >   "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
182 > + "In-reply-to": "<bar@baz.com>",\r
183 > + "References": "<foo@two.com>",\r
184 >   "Date": "Fri, 05 Jan 2001 15:43:57 +0000"},\r
185 >   "body": [{"id": 1,\r
186 >   "content-type": "text/plain", "content": "This is just a test message (#4)\n"}]},\r
187 > @@ -95,6 +99,7 @@ expected='[[[{"id": "foo@three.com", "match": true, "excluded": false,\r
188 >   "headers": {"Subject": "Re: three",\r
189 >   "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
190 >   "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
191 > + "In-reply-to": "<foo@three.com>",\r
192 >   "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1,\r
193 >   "content-type": "text/plain", "content": "This is just a test message (#6)\n"}]},\r
194 >   []]]]]]'\r
195 > @@ -124,6 +129,8 @@ expected='[[[{"id": "foo@four.com", "match": true, "excluded": false,\r
196 >   "headers": {"Subject": "neither",\r
197 >   "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
198 >   "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
199 > + "In-reply-to": "<baz@four.com>",\r
200 > + "References": "<baz@four.com> <foo@four.com>",\r
201 >   "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1,\r
202 >   "content-type": "text/plain", "content": "This is just a test message (#9)\n"}]},\r
203 >   []]]]], [[{"id": "bar@four.com", "match": true, "excluded": false,\r
204 > -- \r
205 > 1.8.4\r
206 >\r
207 > _______________________________________________\r
208 > notmuch mailing list\r
209 > notmuch@notmuchmail.org\r
210 > http://notmuchmail.org/mailman/listinfo/notmuch\r