+ if (node->envelope_file) {
+ g_mime_stream_printf (stream, "On %s, %s wrote:\n",
+ notmuch_message_get_header (node->envelope_file, "date"),
+ notmuch_message_get_header (node->envelope_file, "from"));
+ } else if (GMIME_IS_MESSAGE (node->part)) {
+ GMimeMessage *message = GMIME_MESSAGE (node->part);
+ char *recipients_string;
+
+ g_mime_stream_printf (stream, "> From: %s\n", g_mime_message_get_from_string (message));
+ recipients_string = g_mime_message_get_address_string (message, GMIME_ADDRESS_TYPE_TO);
+ if (recipients_string)
+ g_mime_stream_printf (stream, "> To: %s\n",
+ recipients_string);
+ g_free (recipients_string);
+ recipients_string = g_mime_message_get_address_string (message, GMIME_ADDRESS_TYPE_CC);
+ if (recipients_string)
+ g_mime_stream_printf (stream, "> Cc: %s\n",
+ recipients_string);
+ g_free (recipients_string);
+ g_mime_stream_printf (stream, "> Subject: %s\n", g_mime_message_get_subject (message));
+ g_mime_stream_printf (stream, "> Date: %s\n", g_mime_message_get_date_string (node, message));
+ g_mime_stream_printf (stream, ">\n");
+ } else if (GMIME_IS_PART (node->part)) {
+ GMimeContentType *content_type = g_mime_object_get_content_type (node->part);
+ GMimeContentDisposition *disposition = g_mime_object_get_content_disposition (node->part);
+
+ if (g_mime_content_type_is_type (content_type, "application", "pgp-encrypted") ||
+ g_mime_content_type_is_type (content_type, "application", "pgp-signature") ||
+ g_mime_content_type_is_type (content_type, "application", "pkcs7-mime")) {
+ /* Ignore PGP/MIME and S/MIME cruft parts */
+ } else if (g_mime_content_type_is_type (content_type, "text", "*") &&
+ ! g_mime_content_type_is_type (content_type, "text", "html")) {
+ show_text_part_content (node->part, stream, NOTMUCH_SHOW_TEXT_PART_REPLY);
+ } else if (disposition &&
+ strcasecmp (g_mime_content_disposition_get_disposition (disposition),
+ GMIME_DISPOSITION_ATTACHMENT) == 0) {
+ const char *filename = g_mime_part_get_filename (GMIME_PART (node->part));
+ g_mime_stream_printf (stream, "Attachment: %s (%s)\n", filename,
+ g_mime_content_type_get_mime_type (content_type));
+ } else {
+ g_mime_stream_printf (stream, "Non-text part: %s\n",
+ g_mime_content_type_get_mime_type (content_type));
+ }