mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-22 10:06:44 +00:00
chore(GODT-2916): Split Decryption from Message Building
This helps the export tool to deal with problems arising from message assembly after everything has been successfully encrypted. The original behavior is still available under `DecryptAndBuildRFC822`.
This commit is contained in:
@ -30,10 +30,10 @@ import (
|
||||
// writeCustomTextPart writes an armored-PGP text part for a message body that couldn't be decrypted.
|
||||
func writeCustomTextPart(
|
||||
w *message.Writer,
|
||||
msg proton.Message,
|
||||
decrypted *DecryptedMessage,
|
||||
decError error,
|
||||
) error {
|
||||
enc, err := crypto.NewPGPMessageFromArmored(msg.Body)
|
||||
enc, err := crypto.NewPGPMessageFromArmored(decrypted.Msg.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -48,7 +48,7 @@ func writeCustomTextPart(
|
||||
|
||||
var hdr message.Header
|
||||
|
||||
hdr.SetContentType(string(msg.MIMEType), nil)
|
||||
hdr.SetContentType(string(decrypted.Msg.MIMEType), nil)
|
||||
|
||||
part, err := w.CreatePart(hdr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user