mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Remove blog as well when removing RSS feed
This also adds a confirmation dialog to the removal process.
This commit is contained in:
@@ -224,6 +224,11 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBlog(Transaction txn, Blog b) throws DbException {
|
||||
removeBlog(txn, b, false);
|
||||
}
|
||||
|
||||
private void removeBlog(Transaction txn, Blog b, boolean forced)
|
||||
throws DbException {
|
||||
if (!forced && !canBeRemoved(txn, b.getId()))
|
||||
|
||||
@@ -203,22 +203,20 @@ class FeedManagerImpl implements FeedManager, Client, EventListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFeed(String url) throws DbException {
|
||||
public void removeFeed(Feed feed) throws DbException {
|
||||
LOG.info("Removing RSS feed...");
|
||||
Transaction txn = db.startTransaction(false);
|
||||
try {
|
||||
List<Feed> feeds = getFeeds(txn);
|
||||
Feed feed = null;
|
||||
for (Feed f : feeds) {
|
||||
if (f.getUrl().equals(url)) {
|
||||
if (f.getBlogId().equals(feed.getBlogId())) {
|
||||
feed = f;
|
||||
feeds.remove(f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (feed == null) throw new DbException();
|
||||
storeFeeds(txn, feeds);
|
||||
// TODO blogManager.removeBlog(txn, feed.getBlog());
|
||||
blogManager.removeBlog(txn, feed.getBlog());
|
||||
db.commitTransaction(txn);
|
||||
} finally {
|
||||
db.endTransaction(txn);
|
||||
|
||||
Reference in New Issue
Block a user