mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Change blog descriptor format to include RSS feed flag
This now also handles the case where an RSS blog is deleted via the blog deletion option and not the feed management.
This commit is contained in:
@@ -13,16 +13,22 @@ import javax.annotation.concurrent.Immutable;
|
||||
public class Blog extends BaseGroup implements Shareable {
|
||||
|
||||
private final Author author;
|
||||
private final boolean rssFeed;
|
||||
|
||||
public Blog(Group group, Author author) {
|
||||
public Blog(Group group, Author author, boolean rssFeed) {
|
||||
super(group);
|
||||
this.author = author;
|
||||
this.rssFeed = rssFeed;
|
||||
}
|
||||
|
||||
public Author getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public boolean isRssFeed() {
|
||||
return rssFeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Blog && super.equals(o);
|
||||
|
||||
@@ -13,6 +13,11 @@ public interface BlogFactory {
|
||||
*/
|
||||
Blog createBlog(Author author);
|
||||
|
||||
/**
|
||||
* Creates a RSS feed blog for a given author.
|
||||
*/
|
||||
Blog createFeedBlog(Author author);
|
||||
|
||||
/**
|
||||
* Parses a blog with the given Group
|
||||
*/
|
||||
|
||||
@@ -93,21 +93,9 @@ public class Feed {
|
||||
if (this == o) return true;
|
||||
if (o instanceof Feed) {
|
||||
Feed f = (Feed) o;
|
||||
return url.equals(f.url) && blog.equals(f.blog) &&
|
||||
equalsWithNull(title, f.title) &&
|
||||
equalsWithNull(description, f.description) &&
|
||||
equalsWithNull(author, f.author) &&
|
||||
added == f.added &&
|
||||
updated == f.updated &&
|
||||
lastEntryTime == f.lastEntryTime;
|
||||
return blog.equals(f.blog);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean equalsWithNull(@Nullable Object a, @Nullable Object b) {
|
||||
if (a == b) return true;
|
||||
if (a == null || b == null) return false;
|
||||
return a.equals(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user