show: Pass notmuch_message_t instead of path to show_message_body.
authorAustin Clements <amdragon@MIT.EDU>
Sat, 24 Dec 2011 18:52:43 +0000 (13:52 -0500)
committerDavid Bremner <bremner@debian.org>
Mon, 26 Dec 2011 02:17:27 +0000 (22:17 -0400)
In addition to simplifying the code, we'll need the notmuch_message_t*
in show_message_body shortly.

notmuch-client.h
notmuch-reply.c
notmuch-show.c
show-message.c

index c602e2e08c28fd2d2d9011c2eacb3f7dac8f1d75..c521efa0a63559cc06422d36fc771dbf22d2dcae 100644 (file)
@@ -162,7 +162,7 @@ char *
 query_string_from_args (void *ctx, int argc, char *argv[]);
 
 notmuch_status_t
-show_message_body (const char *filename,
+show_message_body (notmuch_message_t *message,
                   const notmuch_show_format_t *format,
                   notmuch_show_params_t *params);
 
index 7ac879f94419aa4d7783a0cb6d0be8912baad79b..f8d5f64716e2a47e39a2d6767f4e36eeab980d5a 100644 (file)
@@ -546,8 +546,7 @@ notmuch_reply_format_default(void *ctx,
                notmuch_message_get_header (message, "date"),
                notmuch_message_get_header (message, "from"));
 
-       show_message_body (notmuch_message_get_filename (message),
-                          format, params);
+       show_message_body (message, format, params);
 
        notmuch_message_destroy (message);
     }
index 19fb49f29b89172b63eed772ab79297e986904a1..0200b9c4a4cd28fe7126d83b5b0045c82037e9bb 100644 (file)
@@ -758,8 +758,7 @@ show_message (void *ctx,
     }
 
     if (format->part_content)
-       show_message_body (notmuch_message_get_filename (message),
-                          format, params);
+       show_message_body (message, format, params);
 
     if (params->part <= 0) {
        fputs (format->body_end, stdout);
index d83f04ecc553264bd42b28867e5154c33966b4f2..09fa607f3301533c53df6f30058351224ff473fe 100644 (file)
@@ -175,7 +175,7 @@ show_message_part (GMimeObject *part,
 }
 
 notmuch_status_t
-show_message_body (const char *filename,
+show_message_body (notmuch_message_t *message,
                   const notmuch_show_format_t *format,
                   notmuch_show_params_t *params)
 {
@@ -183,6 +183,7 @@ show_message_body (const char *filename,
     GMimeParser *parser = NULL;
     GMimeMessage *mime_message = NULL;
     notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
+    const char *filename = notmuch_message_get_filename (message);
     FILE *file = NULL;
     show_message_state_t state;