Diffusion GpgOL 9e4788126247

Add initial draft encryption support

Authored by aheinecke on Apr 10 2019, 9:30 AM.

Description

Add initial draft encryption support

* src/common_indep.h (opt): Add option draft_key.
* src/cryptcontroller.cpp (CryptController::resolve_keys): Handle
draft and resolve to draft key.
(CryptController::do_crypto): Don't sign draft encrypts.
* src/mail.cpp (Mail::Mail): New state variable for drafts.
(do_crypt): Handle draft encryption.
(Mail::encryptSignStart_o): Disable inline pgp for drafts.
(Mail::updateCryptOOM_o): Don't wipe but trick Outlook when
encrypting drafts.
(Mail::prepareCrypto_o): New. Factored out from send event.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (BeforeAutoSave): New. Start
encryption.
(Write, AfterWrite): Add handling for drafts.
* src/main.c (read_options): Read draftKey and draftEnc.
* src/windowmessages.cpp (CRYPTO_DONE): Handle drafts.

This uses some tricks to add draft encryption in a
way that the user does not notice. E.g. when an
autosave happens.

It's still a bit fragile and needs more work but the
basics work for explict draft save and autosave.

Details

Committed
aheineckeApr 10 2019, 9:30 AM
Parents
rO49c36afbba98: Silence a too verbose trace
Branches
Unknown
Tags
Unknown
Tasks
T4388: GpgOL: Add draft encryption as an option.