X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=44297251d02183121685a0cb5bda2cae76cdbea4;hp=13e38c209740208cf7fdffa4b11eab146410473e;hb=HEAD;hpb=d447b694b498c3e18a22f1eb15139a798c6aab26 diff --git a/notmuch-reply.c b/notmuch-reply.c index 13e38c20..44297251 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -663,7 +663,7 @@ do_reply (notmuch_database_t *notmuch, notmuch_messages_move_to_next (messages)) { message = notmuch_messages_get (messages); - if (mime_node_open (notmuch, message, ¶ms->crypto, &node)) + if (mime_node_open (notmuch, message, params->duplicate, ¶ms->crypto, &node)) return 1; reply = create_reply_message (notmuch, message, @@ -683,7 +683,7 @@ do_reply (notmuch_database_t *notmuch, /* Start the original */ sp->map_key (sp, "original"); - format_part_sprinter (notmuch, sp, node, true, false); + format_part_sprinter (notmuch, sp, node, params->duplicate, true, false); /* End */ sp->end (sp); @@ -715,10 +715,12 @@ notmuch_reply_command (notmuch_database_t *notmuch, int argc, char *argv[]) int opt_index; notmuch_show_params_t params = { .part = -1, + .duplicate = 0, .crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO }, }; int format = FORMAT_DEFAULT; int reply_all = true; + notmuch_status_t status; notmuch_opt_desc_t options[] = { { .opt_keyword = &format, .name = "format", .keywords = @@ -738,6 +740,7 @@ notmuch_reply_command (notmuch_database_t *notmuch, int argc, char *argv[]) { "auto", NOTMUCH_DECRYPT_AUTO }, { "true", NOTMUCH_DECRYPT_NOSTASH }, { 0, 0 } } }, + { .opt_int = ¶ms.duplicate, .name = "duplicate" }, { .opt_inherit = notmuch_shared_options }, { } }; @@ -761,11 +764,11 @@ notmuch_reply_command (notmuch_database_t *notmuch, int argc, char *argv[]) return EXIT_FAILURE; } - query = notmuch_query_create (notmuch, query_string); - if (query == NULL) { - fprintf (stderr, "Out of memory\n"); + status = notmuch_query_create_with_syntax (notmuch, query_string, + shared_option_query_syntax (), + &query); + if (print_status_database ("notmuch reply", notmuch, status)) return EXIT_FAILURE; - } if (do_reply (notmuch, query, ¶ms, format, reply_all) != 0) return EXIT_FAILURE;