summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
98a26cf)
Tweak the return values of CryptoManager#decrypt so that the notice widget is
the first thing returned regardless. Makes the code cleaner.
end
notice = Chunk::CryptoNotice.new :valid, "This message has been decrypted for display"
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)]
- 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")
- 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.
end
## takes a RMail::Message, breaks it into Chunk:: classes.