Display the user fields for the admin account

This commit is contained in:
Michael 2020-10-25 20:32:45 +00:00
parent 319ceeda3b
commit d8d96e6e61
2 changed files with 8 additions and 4 deletions

View file

@ -69,8 +69,12 @@ class Account extends BaseFactory
$apcontact = APContact::getByURL($publicContact['url'], false); $apcontact = APContact::getByURL($publicContact['url'], false);
$profileFields = $this->profileField->select(['uid' => $uid, 'psid' => PermissionSet::PUBLIC]); if (!empty($userContact['self'])) {
$fields = $this->mstdnField->createFromProfileFields($profileFields); $profileFields = $this->profileField->select(['uid' => $uid, 'psid' => PermissionSet::PUBLIC]);
$fields = $this->mstdnField->createFromProfileFields($profileFields);
} else {
$fields = new Fields();
}
return new \Friendica\Object\Api\Mastodon\Account($this->baseUrl, $publicContact, $fields, $apcontact, $userContact); return new \Friendica\Object\Api\Mastodon\Account($this->baseUrl, $publicContact, $fields, $apcontact, $userContact);
} }

View file

@ -93,8 +93,8 @@ class Instance extends BaseEntity
$adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email'))); $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
$administrator = User::getByEmail($adminList[0], ['nickname']); $administrator = User::getByEmail($adminList[0], ['nickname']);
if (!empty($administrator)) { if (!empty($administrator)) {
$adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]); $adminContact = DBA::selectFirst('contact', ['id', 'uid'], ['nick' => $administrator['nickname'], 'self' => true]);
$instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']); $instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id'], $adminContact['uid']);
} }
} }