Show avatars for contacts outside AuthorView

This commit is contained in:
Torsten Grote
2020-11-24 16:03:00 -03:00
parent 1b0cb532de
commit 6e57d7bb42
23 changed files with 189 additions and 94 deletions

View File

@@ -53,6 +53,17 @@ class AuthorManagerImpl implements AuthorManager {
if (contacts.isEmpty()) return new AuthorInfo(UNKNOWN);
if (contacts.size() > 1) throw new AssertionError();
Contact c = contacts.iterator().next();
return getAuthorInfo(txn, c);
}
@Override
public AuthorInfo getAuthorInfo(Contact c) throws DbException {
return db.transactionWithResult(true, txn -> getAuthorInfo(txn, c));
}
@Override
public AuthorInfo getAuthorInfo(Transaction txn, Contact c)
throws DbException {
AttachmentHeader avatar = avatarManager.getAvatarHeader(txn, c);
if (c.isVerified())
return new AuthorInfo(VERIFIED, c.getAlias(), avatar);