diff --git a/briar-api/src/org/briarproject/api/forum/ForumManager.java b/briar-api/src/org/briarproject/api/forum/ForumManager.java index bd5657b01..7c619294b 100644 --- a/briar-api/src/org/briarproject/api/forum/ForumManager.java +++ b/briar-api/src/org/briarproject/api/forum/ForumManager.java @@ -31,6 +31,9 @@ public interface ForumManager { /** Returns the forum with the given ID. */ Forum getForum(GroupId g) throws DbException; + /** Returns the forum with the given ID. */ + Forum getForum(Transaction txn, GroupId g) throws DbException; + /** Returns all forums to which the user subscribes. */ Collection getForums() throws DbException; diff --git a/briar-core/src/org/briarproject/forum/ForumManagerImpl.java b/briar-core/src/org/briarproject/forum/ForumManagerImpl.java index 63d4a2db8..d2a2b14d8 100644 --- a/briar-core/src/org/briarproject/forum/ForumManagerImpl.java +++ b/briar-core/src/org/briarproject/forum/ForumManagerImpl.java @@ -141,15 +141,21 @@ class ForumManagerImpl implements ForumManager { @Override public Forum getForum(GroupId g) throws DbException { + Forum forum; + Transaction txn = db.startTransaction(true); try { - Group group; - Transaction txn = db.startTransaction(true); - try { - group = db.getGroup(txn, g); - txn.setComplete(); - } finally { - db.endTransaction(txn); - } + forum = getForum(txn, g); + txn.setComplete(); + } finally { + db.endTransaction(txn); + } + return forum; + } + + @Override + public Forum getForum(Transaction txn, GroupId g) throws DbException { + try { + Group group = db.getGroup(txn, g); return parseForum(group); } catch (FormatException e) { throw new DbException(e);