[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / 93 / b4b0f27744c27ea669282dcf7ef4a1992f0fbf
1 Return-Path: <dme@dme.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 B1587431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:04:00 -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: -1.062\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.062 tagged_above=-999 required=5\r
12         tests=[AWL=-0.877, BAYES_40=-0.185] autolearn=ham\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 L4-hcarvUYTK for <notmuch@notmuchmail.org>;\r
16         Fri, 12 Feb 2010 07:03:59 -0800 (PST)\r
17 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158])\r
18         by olra.theworths.org (Postfix) with ESMTP id A8F3E431FAE\r
19         for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:03:59 -0800 (PST)\r
20 Received: by fg-out-1718.google.com with SMTP id e12so263064fga.2\r
21         for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:03:58 -0800 (PST)\r
22 Received: by 10.86.239.1 with SMTP id m1mr2874615fgh.57.1265987038668;\r
23         Fri, 12 Feb 2010 07:03:58 -0800 (PST)\r
24 Received: from aw.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])\r
25         by mx.google.com with ESMTPS id d4sm1172241fga.3.2010.02.12.07.03.57\r
26         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
27         Fri, 12 Feb 2010 07:03:57 -0800 (PST)\r
28 Received: by aw.hh.sledj.net (Postfix, from userid 1000)\r
29         id 62EB53A03A; Fri, 12 Feb 2010 15:03:39 +0000 (GMT)\r
30 To: notmuch <notmuch@notmuchmail.org>\r
31 From: David Edmondson <dme@dme.org>\r
32 Date: Fri, 12 Feb 2010 15:03:39 +0000\r
33 Message-ID: <87zl3esdh0.fsf@aw.hh.sledj.net>\r
34 MIME-Version: 1.0\r
35 Content-Type: multipart/mixed; boundary="=-=-="\r
36 Subject: [notmuch] [RFC] improved display of message/rfc822 parts\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 12 Feb 2010 15:04:00 -0000\r
50 \r
51 --=-=-=\r
52 \r
53 I seem to get a lot of forwarded message/rfc822 parts and the default\r
54 formatting (which is to inline the contents of the included message) is\r
55 very confusing.\r
56 \r
57 Attached is a patch which attempts to improve this. Given that I'm new\r
58 to notmuch hacking, any comments would be appreciated.\r
59 \r
60 \r
61 --=-=-=\r
62 Content-Type: text/x-diff\r
63 Content-Disposition: inline;\r
64  filename=0001-show-Make-message-rfc822-parts-explicit-in-show-outp.patch\r
65 \r
66 >From 7fd7ad00f4b8f8a2610eb15eeee98a1c0bb4351e Mon Sep 17 00:00:00 2001\r
67 From: David Edmondson <dme@dme.org>\r
68 Date: Fri, 12 Feb 2010 15:01:06 +0000\r
69 Subject: [PATCH] show: Make message/rfc822 parts explicit in show output.\r
70  show: Display header information for message/rfc822 parts.\r
71 \r
72 ---\r
73  notmuch-show.c |   32 ++++++++++++++++++++++++++++++++\r
74  1 files changed, 32 insertions(+), 0 deletions(-)\r
75 \r
76 diff --git a/notmuch-show.c b/notmuch-show.c\r
77 index 376aacd..6f12560 100644\r
78 --- a/notmuch-show.c\r
79 +++ b/notmuch-show.c\r
80 @@ -97,6 +97,34 @@ show_part_content (GMimeObject *part)\r
81  }\r
82  \r
83  static void\r
84 +show_message_rfc822 (GMimeObject *part, int *part_count,\r
85 +                    void (*show_part) (GMimeObject *part, int *part_count))\r
86 +{\r
87 +    GMimeMessage *message;\r
88 +    const char *headers[] = {\r
89 +       "Subject", "From", "To", "Cc", "Bcc", "Date"\r
90 +    };\r
91 +    const char *name, *value;\r
92 +    unsigned int i;\r
93 +\r
94 +    *part_count = *part_count + 1;\r
95 +\r
96 +    message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (part));\r
97 +\r
98 +    printf ("\n");\r
99 +    for (i = 0; i < ARRAY_SIZE (headers); i++) {\r
100 +       name = headers[i];\r
101 +       value = g_mime_object_get_header (GMIME_OBJECT (message), name);\r
102 +       if (value)\r
103 +           printf ("%s: %s\n", name, value);\r
104 +    }\r
105 +    printf ("\n");\r
106 +\r
107 +    show_part (g_mime_message_get_mime_part (message),\r
108 +              part_count);\r
109 +}\r
110 +\r
111 +static void\r
112  show_part (GMimeObject *part, int *part_count)\r
113  {\r
114      GMimeContentDisposition *disposition;\r
115 @@ -137,6 +165,10 @@ show_part (GMimeObject *part, int *part_count)\r
116      {\r
117         show_part_content (part);\r
118      }\r
119 +    else if (g_mime_content_type_is_type (content_type, "message", "rfc822"))\r
120 +    {\r
121 +       show_message_rfc822 (part, part_count, show_part);\r
122 +    }\r
123      else\r
124      {\r
125         printf ("Non-text part: %s\n",\r
126 -- \r
127 1.6.6.1\r
128 \r
129 \r
130 --=-=-=\r
131 \r
132 \r
133 dme.\r
134 -- \r
135 David Edmondson, http://dme.org\r
136 \r
137 --=-=-=--\r