diff --git a/src/Factory/Api/Mastodon/Account.php b/src/Factory/Api/Mastodon/Account.php index a7aa64245..d7e94819e 100644 --- a/src/Factory/Api/Mastodon/Account.php +++ b/src/Factory/Api/Mastodon/Account.php @@ -69,8 +69,12 @@ class Account extends BaseFactory $apcontact = APContact::getByURL($publicContact['url'], false); - $profileFields = $this->profileField->select(['uid' => $uid, 'psid' => PermissionSet::PUBLIC]); - $fields = $this->mstdnField->createFromProfileFields($profileFields); + if (!empty($userContact['self'])) { + $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); } diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 6105a8bee..c52e59f8a 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -93,8 +93,8 @@ class Instance extends BaseEntity $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email'))); $administrator = User::getByEmail($adminList[0], ['nickname']); if (!empty($administrator)) { - $adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]); - $instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']); + $adminContact = DBA::selectFirst('contact', ['id', 'uid'], ['nick' => $administrator['nickname'], 'self' => true]); + $instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id'], $adminContact['uid']); } }