Extracted as variable to have 2 more array fields moved to array initialization.

This commit is contained in:
Roland Häder 2022-07-29 17:19:07 +02:00
parent 676ca36c52
commit 1210e235fb
Signed by: roland
GPG Key ID: C82EDE5DDFA0BA77
1 changed files with 5 additions and 4 deletions

View File

@ -703,6 +703,7 @@ class Contact
}
$file_suffix = 'jpg';
$url = DI::baseUrl() . '/profile/' . $user['nickname'];
$fields = [
'name' => $profile['name'],
@ -717,7 +718,10 @@ class Contact
'xmpp' => $profile['xmpp'],
'matrix' => $profile['matrix'],
'network' => Protocol::DFRN,
'url' => DI::baseUrl() . '/profile/' . $user['nickname'],
'url' => $url,
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
'nurl' => Strings::normaliseLink($url),
'uri-id' => ItemURI::getIdByURI($url),
'addr' => $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3),
'request' => DI::baseUrl() . '/dfrn_request/' . $user['nickname'],
'notify' => DI::baseUrl() . '/dfrn_notify/' . $user['nickname'],
@ -726,9 +730,6 @@ class Contact
'poco' => DI::baseUrl() . '/poco/' . $user['nickname'],
];
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
$fields['nurl'] = Strings::normaliseLink($fields['url']);
$fields['uri-id'] = ItemURI::getIdByURI($fields['url']);
$avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
if (DBA::isResult($avatar)) {