Merge pull request #827 from k9mail/GH-604_always_load_headers

Always load headers when fetching a message from LocalStore
This commit is contained in:
cketti 2015-10-11 12:55:52 +02:00
commit 86d7a17466
2 changed files with 7 additions and 3 deletions

View file

@ -652,6 +652,7 @@ public class LocalFolder extends Folder<LocalMessage> implements Serializable {
LocalMessage localMessage = (LocalMessage) message;
loadMessageParts(db, localMessage);
localMessage.loadHeadersIfNecessary();
}
}
} catch (MessagingException e) {

View file

@ -17,10 +17,7 @@ import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MessageExtractor;
import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
import com.fsck.k9.mailstore.LockableDatabase.WrappedException;
@ -453,6 +450,12 @@ public class LocalMessage extends MimeMessage {
getFolder().populateHeaders(this);
}
void loadHeadersIfNecessary() throws MessagingException {
if (!mHeadersLoaded) {
loadHeaders();
}
}
@Override
public void setHeader(String name, String value) throws MessagingException {
if (!mHeadersLoaded)