ForumManager: Added parent id to metadata and a unit test

This commit is contained in:
Ernir Erlingsson
2016-05-24 13:07:58 +02:00
committed by Torsten Grote
parent 2a7990f5c4
commit 21b237a629
7 changed files with 235 additions and 22 deletions

View File

@@ -49,4 +49,15 @@ public interface ForumConstants {
int TASK_UNSHARE_FORUM_SHARED_BY_US = 6;
int TASK_UNSHARE_FORUM_SHARED_WITH_US = 7;
// Database keys
String KEY_TIMESTAMP = "timestamp";
String KEY_PARENT = "parent";
String KEY_ID = "id";
String KEY_NAME = "name";
String KEY_PUBLIC_NAME = "publicKey";
String KEY_AUTHOR = "author";
String KEY_CONTENT_TYPE = "contentType";
String KEY_LOCAL = "local";
String KEY_READ = "read";
}

View File

@@ -6,15 +6,18 @@ import org.briarproject.api.sync.MessageId;
public class ForumPostHeader {
private final MessageId id;
private final MessageId parentId;
private final long timestamp;
private final Author author;
private final Author.Status authorStatus;
private final String contentType;
private final boolean read;
public ForumPostHeader(MessageId id, long timestamp, Author author,
Author.Status authorStatus, String contentType, boolean read) {
public ForumPostHeader(MessageId id, MessageId parentId, long timestamp,
Author author, Author.Status authorStatus, String contentType,
boolean read) {
this.id = id;
this.parentId = parentId;
this.timestamp = timestamp;
this.author = author;
this.authorStatus = authorStatus;
@@ -45,4 +48,8 @@ public class ForumPostHeader {
public boolean isRead() {
return read;
}
public MessageId getParentId() {
return parentId;
}
}