Merge pull request #4419 from k9mail/fix_reply_to_encrypted_message

Fix reply to encrypted message that couldn't be decrypted
This commit is contained in:
cketti 2020-01-08 00:33:23 +01:00 committed by GitHub
commit ad39ac2c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,12 @@ package com.fsck.k9.mailstore;
import java.util.Collections;
import java.util.List;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MimeBodyPart;
import com.fsck.k9.mail.internet.TextBody;
public class MessageViewInfo {
@ -50,7 +54,15 @@ public class MessageViewInfo {
}
public static MessageViewInfo createWithErrorState(Message message, boolean isMessageIncomplete) {
return new MessageViewInfo(message, isMessageIncomplete, null, null, false, null, null, null, null, null, null);
try {
Body emptyBody = new TextBody("");
Part emptyPart = new MimeBodyPart(emptyBody, "text/plain");
String subject = message.getSubject();
return new MessageViewInfo(message, isMessageIncomplete, emptyPart, subject, false, null, null, null, null,
null, null);
} catch (MessagingException e) {
throw new AssertionError(e);
}
}
public static MessageViewInfo createForMetadataOnly(Message message, boolean isMessageIncomplete) {