X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=de21f3b2e8660755ee38b3cd8b2c83e8a586cbfc;hp=11f269f4c984938aa913f20ff2ab2e99a843a403;hb=719897cdc330a41c22271fded8d911035c275dec;hpb=c3eba1c3f85394b977f513059a0585d89a9a4e2d diff --git a/notmuch-reply.c b/notmuch-reply.c index 11f269f4..de21f3b2 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -575,8 +575,7 @@ notmuch_reply_format_default(void *ctx, g_object_unref (G_OBJECT (reply)); reply = NULL; - if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt, - &root) == NOTMUCH_STATUS_SUCCESS) { + if (mime_node_open (ctx, message, &(params->crypto), &root) == NOTMUCH_STATUS_SUCCESS) { format_part_reply (root); talloc_free (root); } @@ -605,8 +604,7 @@ notmuch_reply_format_json(void *ctx, messages = notmuch_query_search_messages (query); message = notmuch_messages_get (messages); - if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt, - &node) != NOTMUCH_STATUS_SUCCESS) + if (mime_node_open (ctx, message, &(params->crypto), &node) != NOTMUCH_STATUS_SUCCESS) return 1; reply = create_reply_message (ctx, config, message, reply_all); @@ -622,7 +620,7 @@ notmuch_reply_format_json(void *ctx, /* Start the original */ printf (", \"original\": "); - format_part_json (ctx, node, TRUE); + format_part_json (ctx, node, TRUE, TRUE); /* End */ printf ("}\n"); @@ -709,6 +707,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) notmuch_show_params_t params = { .part = -1, .crypto = { + .verify = FALSE, .decrypt = FALSE } }; @@ -742,25 +741,6 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) else reply_format_func = notmuch_reply_format_default; - if (params.crypto.decrypt) { -#ifdef GMIME_ATLEAST_26 - /* TODO: GMimePasswordRequestFunc */ - params.crypto.gpgctx = g_mime_gpg_context_new (NULL, "gpg"); -#else - GMimeSession* session = g_object_new (g_mime_session_get_type(), NULL); - params.crypto.gpgctx = g_mime_gpg_context_new (session, "gpg"); -#endif - if (params.crypto.gpgctx) { - g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) params.crypto.gpgctx, FALSE); - } else { - params.crypto.decrypt = FALSE; - fprintf (stderr, "Failed to construct gpg context.\n"); - } -#ifndef GMIME_ATLEAST_26 - g_object_unref (session); -#endif - } - config = notmuch_config_open (ctx, NULL, NULL); if (config == NULL) return 1;