X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=7184a5dfcf887bb6fcb81bc8f1ee63171f7bb286;hp=84a1220f7fdf13b4b2c704ebc4c3a5be1e879e9c;hb=393afbfa6133137f2e6f43e864b09fca0f2c6957;hpb=4d322fb579ea66472912d10c11483844d100d17f diff --git a/notmuch-reply.c b/notmuch-reply.c index 84a1220f..7184a5df 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -47,7 +47,11 @@ format_part_reply (mime_node_t *node) { int i; - if (GMIME_IS_MESSAGE (node->part)) { + if (node->envelope_file) { + printf ("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); InternetAddressList *recipients; const char *recipients_string; @@ -540,13 +544,9 @@ notmuch_reply_format_default(void *ctx, g_object_unref (G_OBJECT (reply)); reply = NULL; - printf ("On %s, %s wrote:\n", - notmuch_message_get_header (message, "date"), - notmuch_message_get_header (message, "from")); - if (mime_node_open (ctx, message, params->cryptoctx, params->decrypt, &root) == NOTMUCH_STATUS_SUCCESS) { - format_part_reply (mime_node_child (root, 0)); + format_part_reply (root); talloc_free (root); } @@ -740,9 +740,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) return 1; } - notmuch = notmuch_database_open (notmuch_config_get_database_path (config), - NOTMUCH_DATABASE_MODE_READ_ONLY); - if (notmuch == NULL) + if (notmuch_database_open (notmuch_config_get_database_path (config), + NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return 1; query = notmuch_query_create (notmuch, query_string); @@ -755,7 +754,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) return 1; notmuch_query_destroy (query); - notmuch_database_close (notmuch); + notmuch_database_destroy (notmuch); if (params.cryptoctx) g_object_unref(params.cryptoctx);