make message status persistent and initialize it from database

This commit is contained in:
Torsten Grote
2015-12-10 10:59:10 -02:00
parent 0a8c42b939
commit aa7d7642bf
6 changed files with 39 additions and 24 deletions

View File

@@ -1,12 +1,11 @@
package org.briarproject.android.contact;
import org.briarproject.api.db.MessageHeader;
import org.briarproject.api.db.MessageHeader.State;
// This class is not thread-safe
class ConversationItem {
public enum State { STORED, SENT, DELIVERED };
private final MessageHeader header;
private byte[] body;
private State status;
@@ -14,7 +13,7 @@ class ConversationItem {
ConversationItem(MessageHeader header) {
this.header = header;
body = null;
status = header.isDelivered() ? State.DELIVERED : State.STORED;
status = header.getStatus();
}
MessageHeader getHeader() {