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

@@ -7,6 +7,7 @@ import org.briarproject.api.identity.LocalAuthor;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
@@ -31,6 +32,11 @@ public interface BlogManager {
/** Stores a local blog post. */
void addLocalPost(Transaction txn, BlogPost p) throws DbException;
/** Add a comment to an existing blog post or reblog it. */
void addLocalComment(LocalAuthor author, GroupId groupId,
@Nullable String comment, BlogPostHeader wHeader)
throws DbException;
/** Returns the blog with the given ID. */
Blog getBlog(GroupId g) throws DbException;
@@ -47,7 +53,7 @@ public interface BlogManager {
Collection<Blog> getBlogs() throws DbException;
/** Returns the header of the blog post with the given ID. */
BlogPostHeader getPostHeader(MessageId m) throws DbException;
BlogPostHeader getPostHeader(GroupId g, MessageId m) throws DbException;
/** Returns the body of the blog post with the given ID. */
byte[] getPostBody(MessageId m) throws DbException;