aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorGravatar Jameson Graef Rollins <jrollins@finestructure.net>2011-05-23 00:46:16 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-05-24 12:19:18 -0700
commitcadfc39de78e8758e35c0957397618d22eef912c (patch)
tree47c9a47dcae2134ef9ed16d916b35639b3c0c6b0 /notmuch-show.c
parenta06889c8d48eff3f3fc76b5cbacc60ce46bd65da (diff)
Fix handling of message/rfc822 parts
Since message/rfc822 parts are really just a special kind of multipart, we here normalize the handling of the two. This will provide access to sub-parts of message/rfc822 parts, which was previously unavailable.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index d11a2b81..65c780e7 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -416,7 +416,8 @@ format_part_text (GMimeObject *part, int *part_count)
show_part_content (part, stream_stdout);
g_object_unref(stream_stdout);
}
- else if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+ else if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+ g_mime_content_type_is_type (content_type, "message", "rfc822"))
{
/* Do nothing for multipart since its content will be printed
* when recursing. */
@@ -483,7 +484,8 @@ format_part_json (GMimeObject *part, int *part_count)
printf (", \"content\": %s", json_quote_chararray (ctx, (char *) part_content->data, part_content->len));
}
- else if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+ else if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+ g_mime_content_type_is_type (content_type, "message", "rfc822"))
{
printf (", \"content\": [");
}
@@ -500,7 +502,8 @@ format_part_end_json (GMimeObject *part)
content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
- if (g_mime_content_type_is_type (content_type, "multipart", "*"))
+ if (g_mime_content_type_is_type (content_type, "multipart", "*") ||
+ g_mime_content_type_is_type (content_type, "message", "rfc822"))
printf ("]");
printf ("}");