Issue 14349: Fix profile page for unrelated contacts

This commit is contained in:
Michael 2024-08-11 05:56:58 +00:00
parent 66e9807876
commit 131e330e61
8 changed files with 440 additions and 476 deletions

View file

@ -100,12 +100,12 @@ class UpdateCredentials extends BaseApi
User::update($user, $uid);
Profile::update($profile, $uid);
$cdata = Contact::getPublicAndUserContactID($owner['id'], $uid);
if (empty($cdata)) {
$ucid = Contact::getUserContactId($owner['id'], $uid);
if (!$ucid) {
DI::mstdnError()->InternalError();
}
$account = DI::mstdnAccount()->createFromContactId($cdata['user'], $uid);
$account = DI::mstdnAccount()->createFromContactId($ucid, $uid);
$this->response->addJsonContent($account->toArray());
}
}

View file

@ -45,13 +45,13 @@ class VerifyCredentials extends BaseApi
DI::mstdnError()->InternalError();
}
$cdata = Contact::getPublicAndUserContactID($self['id'], $uid);
if (empty($cdata)) {
$ucid = Contact::getUserContactId($self['id'], $uid);
if (!$ucid) {
DI::mstdnError()->InternalError();
}
// @todo Support the source property,
$account = DI::mstdnAccount()->createFromContactId($cdata['user'], $uid);
$account = DI::mstdnAccount()->createFromContactId($ucid, $uid);
$this->response->addJsonContent($account->toArray());
}
}