Merge branch '579-unsubscribe-from-shared-blogs' into 'master'

Allow unsubscribing from shared blogs

Only personal blogs from non-contacts can be removed.
This also adds integration tests that check the conditions under which blogs can actually be removed.

Closes #579

See merge request !268
This commit is contained in:
akwizgran
2016-08-05 17:36:36 +00:00
15 changed files with 264 additions and 45 deletions

View File

@@ -11,16 +11,13 @@ public class Blog extends Forum {
private final String description;
@NotNull
private final Author author;
private final boolean permanent;
public Blog(@NotNull Group group, @NotNull String name,
@NotNull String description, @NotNull Author author,
boolean permanent) {
@NotNull String description, @NotNull Author author) {
super(group, name, null);
this.description = description;
this.author = author;
this.permanent = permanent;
}
@NotNull
@@ -32,8 +29,4 @@ public class Blog extends Forum {
public Author getAuthor() {
return author;
}
public boolean isPermanent() {
return permanent;
}
}

View File

@@ -1,7 +1,6 @@
package org.briarproject.api.blogs;
import org.briarproject.api.FormatException;
import org.briarproject.api.contact.Contact;
import org.briarproject.api.identity.Author;
import org.briarproject.api.sync.Group;
import org.jetbrains.annotations.NotNull;

View File

@@ -20,6 +20,9 @@ public interface BlogManager {
Blog addBlog(LocalAuthor localAuthor, String name, String description)
throws DbException;
/** Returns true if a blog can be removed. */
boolean canBeRemoved(GroupId g) throws DbException;
/** Removes and deletes a blog. */
void removeBlog(Blog b) throws DbException;