X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=6b244e6dfa752c329363f0cbf7374d2582282f28;hp=da3accea931aec4a9418534cd698eceed1d3ddfa;hb=bf28c60b9facb898d52759c2be993acac67c26d2;hpb=0f8148e920810349df207414e40b9489dc246c37 diff --git a/notmuch-reply.c b/notmuch-reply.c index da3accea..6b244e6d 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -31,7 +31,7 @@ static void reply_part_content (GMimeObject *part); static const notmuch_show_format_t format_reply = { - "", + "", NULL, "", NULL, "", NULL, reply_headers_message_part, ">\n", "", @@ -203,7 +203,7 @@ scan_address_list (InternetAddressList *list, if (group_list == NULL) continue; - n += scan_address_list (group_list, config, message, type, NULL); + n += scan_address_list (group_list, config, message, type, user_from); } else { InternetAddressMailbox *mailbox; const char *name; @@ -661,7 +661,6 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) notmuch_show_params_t params = { .part = -1 }; int format = FORMAT_DEFAULT; int reply_all = TRUE; - notmuch_bool_t decrypt = FALSE; notmuch_opt_desc_t options[] = { { NOTMUCH_OPT_KEYWORD, &format, "format", 'f', @@ -672,7 +671,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) (notmuch_keyword_t []){ { "all", TRUE }, { "sender", FALSE }, { 0, 0 } } }, - { NOTMUCH_OPT_BOOLEAN, &decrypt, "decrypt", 'd', 0 }, + { NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 }, { 0, 0, 0, 0, 0 } }; @@ -687,16 +686,23 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) else reply_format_func = notmuch_reply_format_default; - if (decrypt) { + if (params.decrypt) { +#ifdef GMIME_ATLEAST_26 + /* TODO: GMimePasswordRequestFunc */ + params.cryptoctx = g_mime_gpg_context_new (NULL, "gpg"); +#else GMimeSession* session = g_object_new (g_mime_session_get_type(), NULL); params.cryptoctx = g_mime_gpg_context_new (session, "gpg"); +#endif if (params.cryptoctx) { g_mime_gpg_context_set_always_trust ((GMimeGpgContext*) params.cryptoctx, FALSE); - params.decrypt = TRUE; } else { + params.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);