Merge pull request #3146 from k9mail/fix-crypto-quote
Return actual root part of message in MessageViewInfo (fixes #3004)
This commit is contained in:
commit
1962defd5a
3 changed files with 7 additions and 3 deletions
|
@ -37,10 +37,10 @@ public class MessageViewInfo {
|
|||
this.extraAttachments = extraAttachments;
|
||||
}
|
||||
|
||||
static MessageViewInfo createWithExtractedContent(Message message, boolean isMessageIncomplete,
|
||||
static MessageViewInfo createWithExtractedContent(Message message, Part rootPart, boolean isMessageIncomplete,
|
||||
String text, List<AttachmentViewInfo> attachments, AttachmentResolver attachmentResolver) {
|
||||
return new MessageViewInfo(
|
||||
message, isMessageIncomplete, message, text, attachments, null, attachmentResolver, null,
|
||||
message, isMessageIncomplete, rootPart, text, attachments, null, attachmentResolver, null,
|
||||
Collections.<AttachmentViewInfo>emptyList());
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public class MessageViewInfoExtractor {
|
|||
!message.isSet(Flag.X_DOWNLOADED_FULL) || MessageExtractor.hasMissingParts(message);
|
||||
|
||||
return MessageViewInfo.createWithExtractedContent(
|
||||
message, isMessageIncomplete, viewable.html, attachmentInfos, attachmentResolver);
|
||||
message, contentPart, isMessageIncomplete, viewable.html, attachmentInfos, attachmentResolver);
|
||||
}
|
||||
|
||||
private ViewableExtractedText extractViewableAndAttachments(List<Part> parts,
|
||||
|
|
|
@ -406,6 +406,8 @@ public class MessageViewInfoExtractorTest {
|
|||
|
||||
assertEquals("<pre class=\"k9mail\">text</pre>", messageViewInfo.text);
|
||||
assertSame(annotation, messageViewInfo.cryptoResultAnnotation);
|
||||
assertSame(message, messageViewInfo.message);
|
||||
assertSame(message, messageViewInfo.rootPart);
|
||||
assertTrue(messageViewInfo.attachments.isEmpty());
|
||||
assertTrue(messageViewInfo.extraAttachments.isEmpty());
|
||||
}
|
||||
|
@ -427,6 +429,8 @@ public class MessageViewInfoExtractorTest {
|
|||
|
||||
assertEquals("<pre class=\"k9mail\">replacement text</pre>", messageViewInfo.text);
|
||||
assertSame(annotation, messageViewInfo.cryptoResultAnnotation);
|
||||
assertSame(message, messageViewInfo.message);
|
||||
assertSame(replacementPart, messageViewInfo.rootPart);
|
||||
assertTrue(messageViewInfo.attachments.isEmpty());
|
||||
assertTrue(messageViewInfo.extraAttachments.isEmpty());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue