mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Post RSS entries within one transaction
This also fixes a bug where new feeds was not added properly.
This commit is contained in:
@@ -29,6 +29,9 @@ public interface BlogManager {
|
||||
/** Stores a local blog post. */
|
||||
void addLocalPost(BlogPost p) throws DbException;
|
||||
|
||||
/** Stores a local blog post. */
|
||||
void addLocalPost(Transaction txn, BlogPost p) throws DbException;
|
||||
|
||||
/** Returns the blog with the given ID. */
|
||||
Blog getBlog(GroupId g) throws DbException;
|
||||
|
||||
|
||||
@@ -110,4 +110,25 @@ public class Feed {
|
||||
return lastEntryTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o instanceof Feed) {
|
||||
Feed f = (Feed) o;
|
||||
return url.equals(f.url) && blogId.equals(f.getBlogId()) &&
|
||||
equalsWithNull(title, f.getTitle()) &&
|
||||
equalsWithNull(description, f.getDescription()) &&
|
||||
equalsWithNull(author, f.getAuthor()) &&
|
||||
added == f.getAdded() &&
|
||||
updated == f.getUpdated() &&
|
||||
lastEntryTime == f.getLastEntryTime();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean equalsWithNull(Object a, 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