From f04b56f306ef101ff401fb45805b9ea28d28dfab Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 5 Jan 2016 09:36:07 +0100 Subject: [PATCH] Enigma: Enable default signing/encryption on a signed/encrypted draft compose --- plugins/enigma/enigma.js | 5 +++++ plugins/enigma/lib/enigma_ui.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/plugins/enigma/enigma.js b/plugins/enigma/enigma.js index 0f6d19483..bd52d047a 100644 --- a/plugins/enigma/enigma.js +++ b/plugins/enigma/enigma.js @@ -48,6 +48,11 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { }); } + $.each(['encrypt', 'sign'], function() { + if (rcmail.env['enigma_force_' + this]) + $('[name="_enigma_' + this + '"]').prop('checked', true); + }); + if (rcmail.env.enigma_password_request) { rcmail.enigma_password_request(rcmail.env.enigma_password_request); } diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 132b49b31..c12ac4193 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -999,6 +999,10 @@ class enigma_ui $this->rc->output->show_message($msg, 'error'); } + // Check sign/ecrypt options for signed/encrypted drafts + $this->rc->output->set_env('enigma_force_encrypt', !empty($engine->decryptions)); + $this->rc->output->set_env('enigma_force_sign', !empty($engine->signatures)); + return $p; } }