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 2366C429E48
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:37 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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
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 RXAShqdU+RD2 for <notmuch@notmuchmail.org>;
\r
17 Wed, 25 May 2011 18:01:36 -0700 (PDT)
\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
20 by olra.theworths.org (Postfix) with ESMTP id 44E01429E32
\r
21 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 18:01:34 -0700 (PDT)
\r
22 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
23 by fire-doxen-postvirus (Postfix) with ESMTP id E0F2A3282D3;
\r
24 Wed, 25 May 2011 17:55:18 -0700 (PDT)
\r
25 X-Spam-Scanned: at Caltech-IMSS on fire-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 fire-doxen-submit (Postfix) with ESMTP id DF0DB3281DB;
\r
29 Wed, 25 May 2011 17:55:11 -0700 (PDT)
\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)
\r
31 id 6DA457BE; 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 01/11] Simplify reply_part function to eliminate redundant
\r
36 Date: Wed, 25 May 2011 18:01:10 -0700
\r
37 Message-Id: <1306371680-19441-2-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
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:37 -0000
\r
55 This is the same logic but with less code.
\r
57 notmuch-reply.c | 41 ++++++++++++++---------------------------
\r
58 1 files changed, 14 insertions(+), 27 deletions(-)
\r
60 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
61 index ab15650..5d72b1f 100644
\r
62 --- a/notmuch-reply.c
\r
63 +++ b/notmuch-reply.c
\r
64 @@ -88,31 +88,8 @@ static void
\r
65 reply_part (GMimeObject *part,
\r
66 unused (int *part_count))
\r
68 - GMimeContentDisposition *disposition;
\r
69 - GMimeContentType *content_type;
\r
71 - disposition = g_mime_object_get_content_disposition (part);
\r
72 - if (disposition &&
\r
73 - strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
\r
75 - const char *filename = g_mime_part_get_filename (GMIME_PART (part));
\r
76 - content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
\r
78 - if (g_mime_content_type_is_type (content_type, "text", "*") &&
\r
79 - !g_mime_content_type_is_type (content_type, "text", "html"))
\r
81 - reply_part_content (part);
\r
85 - printf ("Attachment: %s (%s)\n", filename,
\r
86 - g_mime_content_type_to_string (content_type));
\r
92 - content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
\r
93 + GMimeContentType *content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
\r
94 + GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (part);
\r
96 if (g_mime_content_type_is_type (content_type, "text", "*") &&
\r
97 !g_mime_content_type_is_type (content_type, "text", "html"))
\r
98 @@ -121,8 +98,18 @@ reply_part (GMimeObject *part,
\r
102 - printf ("Non-text part: %s\n",
\r
103 - g_mime_content_type_to_string (content_type));
\r
104 + if (disposition &&
\r
105 + strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
\r
107 + const char *filename = g_mime_part_get_filename (GMIME_PART (part));
\r
108 + printf ("Attachment: %s (%s)\n", filename,
\r
109 + g_mime_content_type_to_string (content_type));
\r
113 + printf ("Non-text part: %s\n",
\r
114 + g_mime_content_type_to_string (content_type));
\r