Add reference to root part to MessageViewContainer

This commit is contained in:
cketti 2015-02-06 20:03:33 +01:00
parent 49c4115e46
commit cadac6dd89
2 changed files with 11 additions and 7 deletions

View File

@ -450,15 +450,15 @@ public class LocalMessageExtractor {
MessageViewContainer messageViewContainer;
if (pgpAnnotation == NO_ANNOTATIONS) {
messageViewContainer = new MessageViewContainer(viewable.html, attachmentInfos);
messageViewContainer = new MessageViewContainer(viewable.html, part, attachmentInfos);
} else {
OpenPgpSignatureResult pgpResult = pgpAnnotation.getSignatureResult();
OpenPgpError pgpError = pgpAnnotation.getError();
boolean wasEncrypted = pgpAnnotation.wasEncrypted();
PendingIntent pendingIntent = pgpAnnotation.getPendingIntent();
messageViewContainer = new MessageViewContainer(viewable.html, attachmentInfos, pgpResult, pgpError,
wasEncrypted, pendingIntent);
messageViewContainer = new MessageViewContainer(viewable.html, part, attachmentInfos, pgpResult,
pgpError, wasEncrypted, pendingIntent);
}
containers.add(messageViewContainer);

View File

@ -6,6 +6,7 @@ import java.util.List;
import android.app.PendingIntent;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.Part;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.OpenPgpSignatureResult;
@ -23,19 +24,22 @@ public class MessageViewInfo {
public static class MessageViewContainer {
public final String text;
public final Part rootPart;
public final List<AttachmentViewInfo> attachments;
public final boolean encrypted;
public final OpenPgpSignatureResult signatureResult;
public final OpenPgpError pgpError;
public final PendingIntent pgpPendingIntent;
MessageViewContainer(String text, List<AttachmentViewInfo> attachments) {
this(text, attachments, null, null, false, null);
MessageViewContainer(String text, Part rootPart, List<AttachmentViewInfo> attachments) {
this(text, rootPart, attachments, null, null, false, null);
}
MessageViewContainer(String text, List<AttachmentViewInfo> attachments, OpenPgpSignatureResult signatureResult,
OpenPgpError pgpError, boolean encrypted, PendingIntent pgpPendingIntent) {
MessageViewContainer(String text, Part rootPart, List<AttachmentViewInfo> attachments,
OpenPgpSignatureResult signatureResult, OpenPgpError pgpError, boolean encrypted,
PendingIntent pgpPendingIntent) {
this.text = text;
this.rootPart = rootPart;
this.attachments = attachments;
this.signatureResult = signatureResult;
this.pgpError = pgpError;