From 1a956977d926bd9132479e97e62065baea7a0d90 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sun, 26 Mar 2017 18:31:43 -0700 Subject: [PATCH] Remove redraw parameter from crypt send_menus. The parameter was used to notify the caller if the sign (a)s menu was invoked, which displayed the key selection menu. This is no longer necessary with the menu stack pop operation. --- compose.c | 4 ++-- crypt-gpgme.c | 11 +++++------ crypt-gpgme.h | 4 ++-- crypt-mod-pgp-classic.c | 4 ++-- crypt-mod-pgp-gpgme.c | 4 ++-- crypt-mod-smime-classic.c | 4 ++-- crypt-mod-smime-gpgme.c | 4 ++-- crypt-mod.h | 2 +- cryptglue.c | 8 ++++---- mutt_crypt.h | 4 ++-- pgp.c | 3 +-- pgp.h | 2 +- smime.c | 5 +---- smime.h | 2 +- 14 files changed, 28 insertions(+), 33 deletions(-) diff --git a/compose.c b/compose.c index 94da43d3..6bce097f 100644 --- a/compose.c +++ b/compose.c @@ -1272,7 +1272,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ crypt_opportunistic_encrypt (msg); redraw_crypt_lines (msg); } - msg->security = crypt_pgp_send_menu (msg, &menu->redraw); + msg->security = crypt_pgp_send_menu (msg); redraw_crypt_lines (msg); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1305,7 +1305,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ crypt_opportunistic_encrypt (msg); redraw_crypt_lines (msg); } - msg->security = crypt_smime_send_menu(msg, &menu->redraw); + msg->security = crypt_smime_send_menu(msg); redraw_crypt_lines (msg); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 7b010d0f..0c71c2f6 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -4701,7 +4701,7 @@ void smime_gpgme_init (void) init_smime (); } -static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime) +static int gpgme_send_menu (HEADER *msg, int is_smime) { crypt_key_t *p; char input_signas[SHORT_STRING]; @@ -4806,7 +4806,6 @@ static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime) msg->security |= SIGN; } - *redraw = REDRAW_FULL; break; case 'b': /* (b)oth */ @@ -4853,14 +4852,14 @@ static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime) return (msg->security); } -int pgp_gpgme_send_menu (HEADER *msg, int *redraw) +int pgp_gpgme_send_menu (HEADER *msg) { - return gpgme_send_menu (msg, redraw, 0); + return gpgme_send_menu (msg, 0); } -int smime_gpgme_send_menu (HEADER *msg, int *redraw) +int smime_gpgme_send_menu (HEADER *msg) { - return gpgme_send_menu (msg, redraw, 1); + return gpgme_send_menu (msg, 1); } static int verify_sender (HEADER *h, gpgme_protocol_t protocol) diff --git a/crypt-gpgme.h b/crypt-gpgme.h index 7f5ecda3..78a98410 100644 --- a/crypt-gpgme.h +++ b/crypt-gpgme.h @@ -48,8 +48,8 @@ BODY *smime_gpgme_sign_message (BODY *a); int pgp_gpgme_verify_one (BODY *sigbdy, STATE *s, const char *tempfile); int smime_gpgme_verify_one (BODY *sigbdy, STATE *s, const char *tempfile); -int pgp_gpgme_send_menu (HEADER *msg, int *redraw); -int smime_gpgme_send_menu (HEADER *msg, int *redraw); +int pgp_gpgme_send_menu (HEADER *msg); +int smime_gpgme_send_menu (HEADER *msg); int smime_gpgme_verify_sender (HEADER *h); diff --git a/crypt-mod-pgp-classic.c b/crypt-mod-pgp-classic.c index 2f69dcdc..cb7f873c 100644 --- a/crypt-mod-pgp-classic.c +++ b/crypt-mod-pgp-classic.c @@ -61,9 +61,9 @@ static int crypt_mod_pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempf) return pgp_verify_one (sigbdy, s, tempf); } -static int crypt_mod_pgp_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_pgp_send_menu (HEADER *msg) { - return pgp_send_menu (msg, redraw); + return pgp_send_menu (msg); } static BODY *crypt_mod_pgp_encrypt_message (BODY *a, char *keylist, int sign) diff --git a/crypt-mod-pgp-gpgme.c b/crypt-mod-pgp-gpgme.c index 183f4eee..a3ed1cec 100644 --- a/crypt-mod-pgp-gpgme.c +++ b/crypt-mod-pgp-gpgme.c @@ -85,9 +85,9 @@ static int crypt_mod_pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempf) return pgp_gpgme_verify_one (sigbdy, s, tempf); } -static int crypt_mod_pgp_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_pgp_send_menu (HEADER *msg) { - return pgp_gpgme_send_menu (msg, redraw); + return pgp_gpgme_send_menu (msg); } static BODY *crypt_mod_pgp_encrypt_message (BODY *a, char *keylist, int sign) diff --git a/crypt-mod-smime-classic.c b/crypt-mod-smime-classic.c index c09db9c7..b671b926 100644 --- a/crypt-mod-smime-classic.c +++ b/crypt-mod-smime-classic.c @@ -61,9 +61,9 @@ static int crypt_mod_smime_verify_one (BODY *sigbdy, STATE *s, const char *tempf return smime_verify_one (sigbdy, s, tempf); } -static int crypt_mod_smime_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_smime_send_menu (HEADER *msg) { - return smime_send_menu (msg, redraw); + return smime_send_menu (msg); } static void crypt_mod_smime_getkeys (ENVELOPE *env) diff --git a/crypt-mod-smime-gpgme.c b/crypt-mod-smime-gpgme.c index ec1b2ba6..a3063632 100644 --- a/crypt-mod-smime-gpgme.c +++ b/crypt-mod-smime-gpgme.c @@ -70,9 +70,9 @@ static int crypt_mod_smime_verify_one (BODY *sigbdy, STATE *s, const char *tempf return smime_gpgme_verify_one (sigbdy, s, tempf); } -static int crypt_mod_smime_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_smime_send_menu (HEADER *msg) { - return smime_gpgme_send_menu (msg, redraw); + return smime_gpgme_send_menu (msg); } static BODY *crypt_mod_smime_build_smime_entity (BODY *a, char *certlist) diff --git a/crypt-mod.h b/crypt-mod.h index 70910eee..da914029 100644 --- a/crypt-mod.h +++ b/crypt-mod.h @@ -53,7 +53,7 @@ typedef int (*crypt_func_verify_one_t) (BODY *sigbdy, STATE *s, typedef void (*crypt_func_pgp_extract_keys_from_attachment_list_t) (FILE *fp, int tag, BODY *top); -typedef int (*crypt_func_send_menu_t) (HEADER *msg, int *redraw); +typedef int (*crypt_func_send_menu_t) (HEADER *msg); /* (SMIME) */ typedef void (*crypt_func_smime_getkeys_t) (ENVELOPE *env); diff --git a/cryptglue.c b/cryptglue.c index b8b8a56a..fbe51bd7 100644 --- a/cryptglue.c +++ b/cryptglue.c @@ -246,10 +246,10 @@ int crypt_pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempf) } -int crypt_pgp_send_menu (HEADER *msg, int *redraw) +int crypt_pgp_send_menu (HEADER *msg) { if (CRYPT_MOD_CALL_CHECK (PGP, send_menu)) - return (CRYPT_MOD_CALL (PGP, send_menu)) (msg, redraw); + return (CRYPT_MOD_CALL (PGP, send_menu)) (msg); return 0; } @@ -380,10 +380,10 @@ int crypt_smime_verify_one (BODY *sigbdy, STATE *s, const char *tempf) return -1; } -int crypt_smime_send_menu (HEADER *msg, int *redraw) +int crypt_smime_send_menu (HEADER *msg) { if (CRYPT_MOD_CALL_CHECK (SMIME, send_menu)) - return (CRYPT_MOD_CALL (SMIME, send_menu)) (msg, redraw); + return (CRYPT_MOD_CALL (SMIME, send_menu)) (msg); return 0; } diff --git a/mutt_crypt.h b/mutt_crypt.h index 131daccd..07c406d3 100644 --- a/mutt_crypt.h +++ b/mutt_crypt.h @@ -239,7 +239,7 @@ BODY *crypt_pgp_encrypt_message (BODY *a, char *keylist, int sign); /* Invoke the PGP command to import a key. */ void crypt_pgp_invoke_import (const char *fname); -int crypt_pgp_send_menu (HEADER *msg, int *redraw); +int crypt_pgp_send_menu (HEADER *msg); /* fixme: needs documentation */ int crypt_pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempf); @@ -289,7 +289,7 @@ BODY *crypt_smime_build_smime_entity (BODY *a, char *certlist); /* Add a certificate and update index file (externally). */ void crypt_smime_invoke_import (char *infile, char *mailbox); -int crypt_smime_send_menu (HEADER *msg, int *redraw); +int crypt_smime_send_menu (HEADER *msg); void crypt_smime_set_sender (const char *sender); diff --git a/pgp.c b/pgp.c index 6a6f3c91..a531c1f2 100644 --- a/pgp.c +++ b/pgp.c @@ -1698,7 +1698,7 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) return b; } -int pgp_send_menu (HEADER *msg, int *redraw) +int pgp_send_menu (HEADER *msg) { pgp_key_t p; char input_signas[SHORT_STRING]; @@ -1826,7 +1826,6 @@ int pgp_send_menu (HEADER *msg, int *redraw) crypt_pgp_void_passphrase (); /* probably need a different passphrase */ } - *redraw = REDRAW_FULL; break; case 'b': /* (b)oth */ diff --git a/pgp.h b/pgp.h index 6f925068..05fc6b00 100644 --- a/pgp.h +++ b/pgp.h @@ -104,6 +104,6 @@ BODY *pgp_traditional_encryptsign (BODY *, int, char *); BODY *pgp_encrypt_message (BODY *, char *, int); BODY *pgp_sign_message (BODY *); -int pgp_send_menu (HEADER *msg, int *redraw); +int pgp_send_menu (HEADER *msg); #endif /* CRYPT_BACKEND_CLASSIC_PGP */ diff --git a/smime.c b/smime.c index 93dba754..8205e6dc 100644 --- a/smime.c +++ b/smime.c @@ -2090,7 +2090,7 @@ int smime_application_smime_handler (BODY *m, STATE *s) return smime_handle_entity (m, s, NULL) ? 0 : -1; } -int smime_send_menu (HEADER *msg, int *redraw) +int smime_send_menu (HEADER *msg) { smime_key_t *key; char *prompt, *letters, *choices; @@ -2218,8 +2218,6 @@ int smime_send_menu (HEADER *msg, int *redraw) case 'S': /* (s)ign in oppenc mode */ if(!SmimeDefaultKey) { - *redraw = REDRAW_FULL; - if ((key = smime_ask_for_key (_("Sign as: "), KEYFLAG_CANSIGN, 0))) { mutt_str_replace (&SmimeDefaultKey, key->hash); @@ -2246,7 +2244,6 @@ int smime_send_menu (HEADER *msg, int *redraw) crypt_smime_void_passphrase (); } - *redraw = REDRAW_FULL; break; case 'b': /* (b)oth */ diff --git a/smime.h b/smime.h index 22f03028..3eb4c652 100644 --- a/smime.h +++ b/smime.h @@ -63,7 +63,7 @@ char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode); void smime_invoke_import (char *, char *); -int smime_send_menu (HEADER *msg, int *redraw); +int smime_send_menu (HEADER *msg); #endif -- 2.50.1