format_part_end_text (GMimeObject *part);
static const notmuch_show_format_t format_text = {
- "",
+ "", NULL,
"\fmessage{ ", format_message_text,
"\fheader{\n", format_headers_text, format_headers_message_part_text, "\fheader}\n",
"\fbody{\n",
format_part_end_json (GMimeObject *part);
static const notmuch_show_format_t format_json = {
- "[",
+ "[", NULL,
"{", format_message_json,
"\"headers\": {", format_headers_json, format_headers_message_part_json, "}",
", \"body\": [",
unused (int indent));
static const notmuch_show_format_t format_mbox = {
- "",
+ "", NULL,
"", format_message_mbox,
"", NULL, NULL, "",
"",
format_part_content_raw (GMimeObject *part);
static const notmuch_show_format_t format_raw = {
- "",
+ "", NULL,
"", NULL,
"", NULL, format_headers_message_part_text, "\n",
"",
InternetAddressList *recipients;
const char *recipients_string;
+ printf ("Subject: %s\n", g_mime_message_get_subject (message));
printf ("From: %s\n", g_mime_message_get_sender (message));
recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
recipients_string = internet_address_list_to_string (recipients, 0);
if (recipients_string)
printf ("Cc: %s\n",
recipients_string);
- printf ("Subject: %s\n", g_mime_message_get_subject (message));
printf ("Date: %s\n", g_mime_message_get_date_as_string (message));
}
printf (", \"keyid\": %s", json_quote_str (ctx_quote, signer->keyid));
}
if (signer->errors != GMIME_SIGNER_ERROR_NONE) {
- printf (", \"errors\": %x", signer->errors);
+ printf (", \"errors\": %d", signer->errors);
}
printf ("}");
int indent,
notmuch_show_params_t *params)
{
+ if (format->part) {
+ void *local = talloc_new (ctx);
+ mime_node_t *root, *part;
+
+ if (mime_node_open (local, message, params->cryptoctx, params->decrypt,
+ &root) == NOTMUCH_STATUS_SUCCESS &&
+ (part = mime_node_seek_dfs (root, (params->part < 0 ?
+ 0 : params->part))))
+ format->part (local, part, indent, params);
+ talloc_free (local);
+ return;
+ }
+
if (params->part <= 0) {
fputs (format->message_start, stdout);
if (format->message)