mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Fix Blog Sharing Backend and Add Blog Sharing Integration Tests
This commit is contained in:
@@ -10,9 +10,7 @@ import org.briarproject.api.identity.IdentityManager;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -69,12 +67,22 @@ class IdentityManagerImpl implements IdentityManager {
|
||||
return author;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalAuthor getLocalAuthor() throws DbException {
|
||||
return getLocalAuthors().iterator().next();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalAuthor getLocalAuthor(Transaction txn) throws DbException {
|
||||
return getLocalAuthors(txn).iterator().next();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<LocalAuthor> getLocalAuthors() throws DbException {
|
||||
Collection<LocalAuthor> authors;
|
||||
Transaction txn = db.startTransaction(true);
|
||||
try {
|
||||
authors = db.getLocalAuthors(txn);
|
||||
authors = getLocalAuthors(txn);
|
||||
txn.setComplete();
|
||||
} finally {
|
||||
db.endTransaction(txn);
|
||||
@@ -82,6 +90,12 @@ class IdentityManagerImpl implements IdentityManager {
|
||||
return authors;
|
||||
}
|
||||
|
||||
private Collection<LocalAuthor> getLocalAuthors(Transaction txn)
|
||||
throws DbException {
|
||||
|
||||
return db.getLocalAuthors(txn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocalAuthor(AuthorId a) throws DbException {
|
||||
Transaction txn = db.startTransaction(false);
|
||||
|
||||
Reference in New Issue
Block a user