Add support for comments and reblogging to Blog Client

Comments and reblogs need to depend on the post they refer to.
Since message dependencies are limited to one group,
the post and also the comments need to be wrapped
when commented on or reblogged to another blog.

For this reason, in addition to comments, two new wrapping message types
are introduced. They retain all data of the original messages and allow
for reconstruction and signature verification.

This commit breaks backwards compatibility with old blog posts.
It removes the content type, title and parent ID from the post
message structure.
This commit is contained in:
Torsten Grote
2016-08-11 19:34:52 -03:00
parent 743fc7dd1f
commit 3dd3a18694
29 changed files with 874 additions and 320 deletions

View File

@@ -27,7 +27,6 @@ public interface ForumConstants {
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

@@ -9,14 +9,11 @@ public class ForumPost {
private final Message message;
private final MessageId parent;
private final Author author;
private final String contentType;
public ForumPost(Message message, MessageId parent, Author author,
String contentType) {
public ForumPost(Message message, MessageId parent, Author author) {
this.message = message;
this.parent = parent;
this.author = author;
this.contentType = contentType;
}
public Message getMessage() {
@@ -30,8 +27,4 @@ public class ForumPost {
public Author getAuthor() {
return author;
}
public String getContentType() {
return contentType;
}
}

View File

@@ -9,9 +9,8 @@ public class ForumPostHeader extends PostHeader
implements MessageTree.MessageNode {
public ForumPostHeader(MessageId id, MessageId parentId, long timestamp,
Author author, Author.Status authorStatus, String contentType,
boolean read) {
super(id, parentId, timestamp, author, authorStatus, contentType, read);
Author author, Author.Status authorStatus, boolean read) {
super(id, parentId, timestamp, author, authorStatus, read);
}
}