[PATCH 1 of 6] Refactor the address list generation out of the find_keys routines

2013-03-15 Thread Kevin J. McCarthy
All four find_keys routines have a similar set up code for generating a single address list out of the to, cc, bcc lists. This patch pulls all the code into crypt_get_keys. This is done to simplify the functions before later patches make them more complicated (with the auto_mode parameter). cr

[PATCH 3 of 6] Pull is_numerical_keyid() into crypt.c

2013-03-15 Thread Kevin J. McCarthy
A subsequent patch (re?)-introduces a call to is_numerical_keyid inside find_keys(). Rather than duplicate the function, this patch pulls it into crypt.c, where find_keys() and pgp_findKeys() can both call it. crypt.c | 20 mutt_crypt.h | 3 +++ pgp.c| 17 +

[PATCH 6 of 6] Add the crypt_opportunistic_encrypt option and calls

2013-03-15 Thread Kevin J. McCarthy
This patch creates the OPTCRYPTOPPORTUNISTICENCRYPT option and documentation. It also adds calls to crypt_opportunistic_encrypt() during initial message composition, after updating to, cc, or bcc, and after editing the message (if edit_headers is enabled). compose.c | 17 + ini

[PATCH 0 of 6] Add crypt_opportunistic_encrypt option

2013-03-15 Thread Kevin J. McCarthy
This patch set implements crypt_opportunistic_encrypt. This option allows mutt to automatically turn encryption on and off based on the message recipients. When emailing one person, a hook turning on crypt_autoencrypt works well enough, but for multiple recipients it breaks down. The hook will t

[PATCH 2 of 6] Introduce an auto_mode parameter

2013-03-15 Thread Kevin J. McCarthy
It's added to the parameter lists through the call stack down to the find_keys calls. No functionality is implemented yet. This patch is separated just to keep other patches more readable. crypt-gpgme.c | 14 -- crypt-gpgme.h | 4 ++-- crypt-mod-pgp-class

[PATCH 5 of 6] Implement crypt_opportunistic_encrypt()

2013-03-15 Thread Kevin J. McCarthy
This function will be called to flip encryption on and off based on message recipients. crypt.c | 30 ++ mutt_crypt.h | 10 -- send.c | 2 +- 3 files changed, 35 insertions(+), 7 deletions(-) # HG changeset patch # User Kevin McCarthy # Date

[PATCH 4 of 6] Implement auto_mode in the find_keys methods

2013-03-15 Thread Kevin J. McCarthy
auto_mode is used by crypt_opportunistic_encrypt to determine whether there are valid keys for all recipients of a message, without prompting the user. The patch wraps around prompts, and makes getkeybyaddr methods return a valid key without prompting. crypt_getkeybyaddr() seems to be a bit diffe