show: Pass notmuch_message_t instead of path to show_message_body.

In addition to simplifying the code, we'll need the notmuch_message_t*
in show_message_body shortly.
This commit is contained in:
Austin Clements 2011-12-24 13:52:43 -05:00 committed by David Bremner
parent c44a0edadc
commit 36f7fe5a1c
4 changed files with 5 additions and 6 deletions

View file

@ -162,7 +162,7 @@ char *
query_string_from_args (void *ctx, int argc, char *argv[]); query_string_from_args (void *ctx, int argc, char *argv[]);
notmuch_status_t notmuch_status_t
show_message_body (const char *filename, show_message_body (notmuch_message_t *message,
const notmuch_show_format_t *format, const notmuch_show_format_t *format,
notmuch_show_params_t *params); notmuch_show_params_t *params);

View file

@ -546,8 +546,7 @@ notmuch_reply_format_default(void *ctx,
notmuch_message_get_header (message, "date"), notmuch_message_get_header (message, "date"),
notmuch_message_get_header (message, "from")); notmuch_message_get_header (message, "from"));
show_message_body (notmuch_message_get_filename (message), show_message_body (message, format, params);
format, params);
notmuch_message_destroy (message); notmuch_message_destroy (message);
} }

View file

@ -758,8 +758,7 @@ show_message (void *ctx,
} }
if (format->part_content) if (format->part_content)
show_message_body (notmuch_message_get_filename (message), show_message_body (message, format, params);
format, params);
if (params->part <= 0) { if (params->part <= 0) {
fputs (format->body_end, stdout); fputs (format->body_end, stdout);

View file

@ -175,7 +175,7 @@ show_message_part (GMimeObject *part,
} }
notmuch_status_t notmuch_status_t
show_message_body (const char *filename, show_message_body (notmuch_message_t *message,
const notmuch_show_format_t *format, const notmuch_show_format_t *format,
notmuch_show_params_t *params) notmuch_show_params_t *params)
{ {
@ -183,6 +183,7 @@ show_message_body (const char *filename,
GMimeParser *parser = NULL; GMimeParser *parser = NULL;
GMimeMessage *mime_message = NULL; GMimeMessage *mime_message = NULL;
notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
const char *filename = notmuch_message_get_filename (message);
FILE *file = NULL; FILE *file = NULL;
show_message_state_t state; show_message_state_t state;