X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=7242310a7ec5f376872ac065044cbfc0e7c1fedb;hp=c500862d36000428284adcec942513911c170e34;hb=80ae1829c19f1fbe714232defcf12f18bc99ddb8;hpb=c75410fd81878ccb9f3fa3878507e5650de5fa3f diff --git a/notmuch-reply.c b/notmuch-reply.c index c500862d..7242310a 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -98,6 +98,11 @@ reply_part_content (GMimeObject *part) { /* Output nothing, since multipart subparts will be handled individually. */ } + else if (g_mime_content_type_is_type (content_type, "application", "pgp-encrypted") || + g_mime_content_type_is_type (content_type, "application", "pgp-signature")) + { + /* Ignore PGP/MIME cruft parts */ + } else if (g_mime_content_type_is_type (content_type, "text", "*") && !g_mime_content_type_is_type (content_type, "text", "html")) { @@ -617,11 +622,11 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) char *opt, *query_string; int i, ret = 0; int (*reply_format_func)(void *ctx, notmuch_config_t *config, notmuch_query_t *query, notmuch_show_params_t *params); - notmuch_show_params_t params; + notmuch_show_params_t params = { .part = -1 }; reply_format_func = notmuch_reply_format_default; - params.part = -1; - params.cryptoctx = NULL; + + argc--; argv++; /* skip subcommand argument */ for (i = 0; i < argc && argv[i][0] == '-'; i++) { if (strcmp (argv[i], "--") == 0) { @@ -641,10 +646,12 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) } else if ((STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) { if (params.cryptoctx == NULL) { GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL); - if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg"))) + if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg"))) { fprintf (stderr, "Failed to construct gpg context.\n"); - else + } else { + params.decrypt = TRUE; g_mime_gpg_context_set_always_trust((GMimeGpgContext*)params.cryptoctx, FALSE); + } g_object_unref (session); session = NULL; }