database error
[notmuch-archives.git] / f5 / 65db9c018368a7a9dad176e6af8f9ef279d297
1 Return-Path: <jrollins@servo.finestructure.net>\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 DB921431FB6\r
6         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 8KKm9hTbbjJB for <notmuch@notmuchmail.org>;\r
17         Wed, 25 May 2011 18:01:39 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id D82D3429E3D\r
21         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:34 -0700 (PDT)\r
22 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by earth-doxen-postvirus (Postfix) with ESMTP id 6D35E66E04A3;\r
24         Wed, 25 May 2011 18:01:33 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (gwave-104.ligo.caltech.edu\r
27         [131.215.114.104]) (Authenticated sender: jrollins)\r
28         by earth-doxen-submit (Postfix) with ESMTP id 8FE7866E04A6;\r
29         Wed, 25 May 2011 18:01:25 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 720F17BF; Wed, 25 May 2011 18:01:26 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: [PATCH 02/11] Integrate reply_part_content function into reply_part\r
35         function.\r
36 Date: Wed, 25 May 2011 18:01:11 -0700\r
37 Message-Id: <1306371680-19441-3-git-send-email-jrollins@finestructure.net>\r
38 X-Mailer: git-send-email 1.7.4.4\r
39 In-Reply-To: <1306371680-19441-1-git-send-email-jrollins@finestructure.net>\r
40 References: <1306371680-19441-1-git-send-email-jrollins@finestructure.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Thu, 26 May 2011 01:01:41 -0000\r
54 \r
55 After the last patch to eliminate some redundant code paths in\r
56 reply_part, the reply_part_content function was only being called\r
57 once.  Disolving the function and integrating its contents into the\r
58 reply_part function makes things a little simpler, and frees up some\r
59 name space that will be needed in the next patch.\r
60 ---\r
61  notmuch-reply.c |   52 +++++++++++++++++++++++-----------------------------\r
62  1 files changed, 23 insertions(+), 29 deletions(-)\r
63 \r
64 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
65 index 5d72b1f..8c5e76c 100644\r
66 --- a/notmuch-reply.c\r
67 +++ b/notmuch-reply.c\r
68 @@ -38,34 +38,6 @@ static const notmuch_show_format_t format_reply = {\r
69  };\r
70  \r
71  static void\r
72 -reply_part_content (GMimeObject *part)\r
73 -{\r
74 -    GMimeStream *stream_stdout = NULL, *stream_filter = NULL;\r
75 -    GMimeDataWrapper *wrapper;\r
76 -    const char *charset;\r
77 -\r
78 -    charset = g_mime_object_get_content_type_parameter (part, "charset");\r
79 -    stream_stdout = g_mime_stream_file_new (stdout);\r
80 -    if (stream_stdout) {\r
81 -       g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);\r
82 -       stream_filter = g_mime_stream_filter_new(stream_stdout);\r
83 -        if (charset) {\r
84 -          g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
85 -                                   g_mime_filter_charset_new(charset, "UTF-8"));\r
86 -        }\r
87 -    }\r
88 -    g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
89 -                            g_mime_filter_reply_new(TRUE));\r
90 -    wrapper = g_mime_part_get_content_object (GMIME_PART (part));\r
91 -    if (wrapper && stream_filter)\r
92 -       g_mime_data_wrapper_write_to_stream (wrapper, stream_filter);\r
93 -    if (stream_filter)\r
94 -       g_object_unref(stream_filter);\r
95 -    if (stream_stdout)\r
96 -       g_object_unref(stream_stdout);\r
97 -}\r
98 -\r
99 -static void\r
100  show_reply_headers (GMimeMessage *message)\r
101  {\r
102      GMimeStream *stream_stdout = NULL, *stream_filter = NULL;\r
103 @@ -94,7 +66,29 @@ reply_part (GMimeObject *part,\r
104      if (g_mime_content_type_is_type (content_type, "text", "*") &&\r
105         !g_mime_content_type_is_type (content_type, "text", "html"))\r
106      {\r
107 -       reply_part_content (part);\r
108 +       GMimeStream *stream_stdout = NULL, *stream_filter = NULL;\r
109 +       GMimeDataWrapper *wrapper;\r
110 +       const char *charset;\r
111 +\r
112 +       charset = g_mime_object_get_content_type_parameter (part, "charset");\r
113 +       stream_stdout = g_mime_stream_file_new (stdout);\r
114 +       if (stream_stdout) {\r
115 +           g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);\r
116 +           stream_filter = g_mime_stream_filter_new(stream_stdout);\r
117 +           if (charset) {\r
118 +               g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
119 +                                        g_mime_filter_charset_new(charset, "UTF-8"));\r
120 +           }\r
121 +       }\r
122 +       g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
123 +                                g_mime_filter_reply_new(TRUE));\r
124 +       wrapper = g_mime_part_get_content_object (GMIME_PART (part));\r
125 +       if (wrapper && stream_filter)\r
126 +           g_mime_data_wrapper_write_to_stream (wrapper, stream_filter);\r
127 +       if (stream_filter)\r
128 +           g_object_unref(stream_filter);\r
129 +       if (stream_stdout)\r
130 +           g_object_unref(stream_stdout);\r
131      }\r
132      else\r
133      {\r
134 -- \r
135 1.7.4.4\r
136 \r