- // Non connected persons can only see the keywords of a Diaspora account
- if ($contact['network'] == Protocol::DIASPORA) {
- $contact['location'] = "";
- $about = "";
+ $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'];