]> git.cworth.org Git - sup/commitdiff
add self as recipient on crypted sent messages
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 2 Nov 2008 19:29:49 +0000 (11:29 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 2 Nov 2008 19:29:49 +0000 (11:29 -0800)
patch from "Tomas Pospisek ML" <tpo2@sourcepole.ch>

lib/sup/crypto.rb

index 0003fec7bc60314dd14d89387d25ae886a7972c6..8ec277b862603fb23d94a60d3fa19fd60ee0fd0f 100644 (file)
@@ -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?