commit 8497d187f078a10400079c3d9580d3baa7aece3b
parent cdb10174bbb4f11f9e01ea3e683b3ad128fcfd2f
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Fri, 4 Sep 2009 10:31:36 -0400
Merge branch 'master' into next
Diffstat:
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -129,10 +129,9 @@ class CryptoManager
end
notice = Chunk::CryptoNotice.new :valid, "This message has been decrypted for display"
- [RMail::Parser.read(decrypted_payload), sig, notice]
+ [notice, sig, RMail::Parser.read(decrypted_payload)]
else
- notice = Chunk::CryptoNotice.new :invalid, "This message could not be decrypted", output.split("\n")
- [nil, nil, notice]
+ Chunk::CryptoNotice.new :invalid, "This message could not be decrypted", output.split("\n")
end
end
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -407,9 +407,13 @@ private
return
end
- decryptedm, sig, notice = CryptoManager.decrypt payload
- children = message_to_chunks(decryptedm, true) if decryptedm
- [notice, sig, children].flatten.compact
+ notice, sig, decryptedm = CryptoManager.decrypt payload
+ if decryptedm # managed to decrypt
+ children = message_to_chunks(decryptedm, true)
+ [notice, sig, children]
+ else
+ [notice]
+ end
end
## takes a RMail::Message, breaks it into Chunk:: classes.