Issue 8967: Fix avatar in top bar

This commit is contained in:
Michael 2020-08-04 20:15:42 +00:00
parent 73c112066d
commit f1380e6af4

View file

@ -195,8 +195,7 @@ function frio_remote_nav($a, &$nav)
// this isn't optimal because the contact query will be done now twice // this isn't optimal because the contact query will be done now twice
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl']; $fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl'];
if (local_user() && !empty($a->user['uid'])) { if (local_user() && !empty($a->user['uid'])) {
$remoteUser = Contact::getById($a->user['uid'], $fields); $remoteUser = DBA::selectFirst('contact', $fields, ['uid' => $a->user['uid'], 'self' => true]);
$remoteUser['name'] = $a->user['username'];
} elseif (!local_user() && remote_user()) { } elseif (!local_user() && remote_user()) {
$remoteUser = Contact::getById(remote_user(), $fields); $remoteUser = Contact::getById(remote_user(), $fields);
$nav['remote'] = DI::l10n()->t('Guest'); $nav['remote'] = DI::l10n()->t('Guest');