mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Change Blog Paradigm to Short-Form
Removes teaser and makes body mandatory. It also adds support for deleting blogs and introduces a getAuthorStatus() method to the IdentityManager that takes a running transaction.
This commit is contained in:
@@ -99,17 +99,24 @@ class IdentityManagerImpl implements IdentityManager {
|
||||
public Status getAuthorStatus(AuthorId authorId) throws DbException {
|
||||
Transaction txn = db.startTransaction(false);
|
||||
try {
|
||||
// Compare to the IDs of the user's identities
|
||||
for (LocalAuthor a : db.getLocalAuthors(txn))
|
||||
if (a.getId().equals(authorId)) return VERIFIED;
|
||||
// Compare to the IDs of contacts' identities
|
||||
for (Contact c : db.getContacts(txn))
|
||||
if (c.getAuthor().getId().equals(authorId)) return VERIFIED;
|
||||
|
||||
// TODO also handle UNVERIFIED when #261 is implemented
|
||||
return UNKNOWN;
|
||||
return getAuthorStatus(txn, authorId);
|
||||
} finally {
|
||||
db.endTransaction(txn);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Status getAuthorStatus(Transaction txn, AuthorId authorId)
|
||||
throws DbException {
|
||||
// Compare to the IDs of the user's identities
|
||||
for (LocalAuthor a : db.getLocalAuthors(txn))
|
||||
if (a.getId().equals(authorId)) return VERIFIED;
|
||||
// Compare to the IDs of contacts' identities
|
||||
for (Contact c : db.getContacts(txn))
|
||||
if (c.getAuthor().getId().equals(authorId)) return VERIFIED;
|
||||
|
||||
// TODO also handle UNVERIFIED when #261 is implemented
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user