Improved self contact detection
This commit is contained in:
parent
d8d96e6e61
commit
44a4b66539
|
@ -69,8 +69,9 @@ class Account extends BaseFactory
|
|||
|
||||
$apcontact = APContact::getByURL($publicContact['url'], false);
|
||||
|
||||
if (!empty($userContact['self'])) {
|
||||
$profileFields = $this->profileField->select(['uid' => $uid, 'psid' => PermissionSet::PUBLIC]);
|
||||
$self_contact = Contact::selectFirst(['uid'], ['nurl' => $publicContact['nurl'], 'self' => true]);
|
||||
if (!empty($self_contact['uid'])) {
|
||||
$profileFields = $this->profileField->select(['uid' => $self_contact['uid'], 'psid' => PermissionSet::PUBLIC]);
|
||||
$fields = $this->mstdnField->createFromProfileFields($profileFields);
|
||||
} else {
|
||||
$fields = new Fields();
|
||||
|
|
|
@ -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', 'uid'], ['nick' => $administrator['nickname'], 'self' => true]);
|
||||
$instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id'], $adminContact['uid']);
|
||||
$adminContact = DBA::selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]);
|
||||
$instance->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue