From: William Morgan Date: Sun, 2 Nov 2008 19:29:49 +0000 (-0800) Subject: add self as recipient on crypted sent messages X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=8bf369135f331ea14ce1e2faac24c2fd81e363c6;p=sup add self as recipient on crypted sent messages patch from "Tomas Pospisek ML" --- diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb index 0003fec..8ec277b 100644 --- a/lib/sup/crypto.rb +++ b/lib/sup/crypto.rb @@ -53,7 +53,7 @@ class CryptoManager payload_fn.write format_payload(payload) payload_fn.close - recipient_opts = to.map { |r| "--recipient '<#{r}>'" }.join(" ") + recipient_opts = (to + [ from ] ).map { |r| "--recipient '<#{r}>'" }.join(" ") sign_opts = sign ? "--sign --local-user '#{from}'" : "" gpg_output = run_gpg "--output - --armor --encrypt --textmode #{sign_opts} #{recipient_opts} #{payload_fn.path}" raise Error, (gpg_output || "gpg command failed: #{cmd}") unless $?.success?