- $entry = array();
- if ($fields_ret['id']) {
- $entry['id'] = (int)$rr['id'];
- }
- if ($fields_ret['displayName']) {
- $entry['displayName'] = $rr['name'];
- }
- if ($fields_ret['aboutMe']) {
- $entry['aboutMe'] = $about;
- }
- if ($fields_ret['currentLocation']) {
- $entry['currentLocation'] = $rr['location'];
- }
- if ($fields_ret['gender']) {
- $entry['gender'] = $rr['gender'];
- }
- if ($fields_ret['generation']) {
- $entry['generation'] = (int)$rr['generation'];
- }
- if ($fields_ret['urls']) {
- $entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
- if ($rr['addr'] && ($rr['network'] !== NETWORK_MAIL)) {
- $entry['urls'][] = array('value' => 'acct:' . $rr['addr'], 'type' => 'webfinger');
- }
- }
- if ($fields_ret['preferredUsername']) {
- $entry['preferredUsername'] = $rr['nick'];
+ $entry = [];
+ if ($fields_ret['id']) {
+ $entry['id'] = (int)$contact['id'];
+ }
+ if ($fields_ret['displayName']) {
+ $entry['displayName'] = $contact['name'];
+ }
+ if ($fields_ret['aboutMe']) {
+ $entry['aboutMe'] = $about;
+ }
+ if ($fields_ret['currentLocation']) {
+ $entry['currentLocation'] = $contact['location'];
+ }
+ if ($fields_ret['generation']) {
+ $entry['generation'] = (int)$contact['generation'];
+ }
+ if ($fields_ret['urls']) {
+ $entry['urls'] = [['value' => $contact['url'], 'type' => 'profile']];
+ if ($contact['addr'] && ($contact['network'] !== Protocol::MAIL)) {
+ $entry['urls'][] = ['value' => 'acct:' . $contact['addr'], 'type' => 'webfinger'];