Include database ID in message parts reconstructed from the database

This commit is contained in:
cketti 2015-01-15 23:35:50 +01:00
parent 8fce9e3654
commit 41bd420213
3 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
package com.fsck.k9.mailstore;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.internet.MimeBodyPart;
public class LocalBodyPart extends MimeBodyPart implements LocalPart {
private final String accountUuid;
private final long messagePartId;
public LocalBodyPart(String accountUuid, long messagePartId) throws MessagingException {
super();
this.accountUuid = accountUuid;
this.messagePartId = messagePartId;
}
@Override
public String getAccountUuid() {
return accountUuid;
}
@Override
public long getId() {
return messagePartId;
}
}

View File

@ -686,7 +686,7 @@ public class LocalFolder extends Folder<LocalMessage> implements Serializable {
String parentMimeType = parentPart.getMimeType();
if (parentMimeType.startsWith("multipart/")) {
BodyPart bodyPart = new MimeBodyPart();
BodyPart bodyPart = new LocalBodyPart(getAccountUuid(), id);
((Multipart) parentPart.getBody()).addBodyPart(bodyPart);
part = bodyPart;
} else if (parentMimeType.startsWith("message/")) {

View File

@ -0,0 +1,7 @@
package com.fsck.k9.mailstore;
public interface LocalPart {
String getAccountUuid();
long getId();
}