GODT-1234 Set attachment name 'message.eml' for message/rfc822 attachments.

This commit is contained in:
Jakub
2021-07-19 14:23:46 +02:00
parent e3e4769d78
commit 63780b7b8d
8 changed files with 143 additions and 8 deletions

View File

@ -75,5 +75,10 @@ func (api *FakePMAPI) CreateAttachment(_ context.Context, attachment *pmapi.Atta
return nil, err
}
attachment.KeyPackets = base64.StdEncoding.EncodeToString(bytes)
msg := api.getMessage(attachment.MessageID)
if msg == nil {
return nil, fmt.Errorf("no such message ID %q", attachment.MessageID)
}
msg.Attachments = append(msg.Attachments, attachment)
return attachment, nil
}