- if($fields_ret['preferredUsername'])
- $entry['preferredUsername'] = $rr['nick'];
- if($fields_ret['updated']) {
- if (!$global) {
- $entry['updated'] = $rr['success_update'];
-
- if ($rr['name-date'] > $entry['updated'])
- $entry['updated'] = $rr['name-date'];
-
- if ($rr['uri-date'] > $entry['updated'])
- $entry['updated'] = $rr['uri-date'];
-
- if ($rr['avatar-date'] > $entry['updated'])
- $entry['updated'] = $rr['avatar-date'];
- } else
- $entry['updated'] = $rr['updated'];
-
+ if ($fields_ret['currentLocation']) {
+ $entry['currentLocation'] = $contact['location'];
+ }
+ if ($fields_ret['gender']) {
+ $entry['gender'] = $contact['gender'];
+ }
+ if ($fields_ret['generation']) {
+ $entry['generation'] = (int)$contact['generation'];
+ }
+ if ($fields_ret['urls']) {
+ $entry['urls'] = array(array('value' => $contact['url'], 'type' => 'profile'));
+ if ($contact['addr'] && ($contact['network'] !== NETWORK_MAIL)) {
+ $entry['urls'][] = array('value' => 'acct:' . $contact['addr'], 'type' => 'webfinger');
+ }
+ }
+ if ($fields_ret['preferredUsername']) {
+ $entry['preferredUsername'] = $contact['nick'];
+ }
+ if ($fields_ret['updated']) {
+ if (! $global) {
+ $entry['updated'] = $contact['success_update'];
+
+ if ($contact['name-date'] > $entry['updated']) {
+ $entry['updated'] = $contact['name-date'];
+ }
+ if ($contact['uri-date'] > $entry['updated']) {
+ $entry['updated'] = $contact['uri-date'];
+ }
+ if ($contact['avatar-date'] > $entry['updated']) {
+ $entry['updated'] = $contact['avatar-date'];
+ }
+ } else {
+ $entry['updated'] = $contact['updated'];
+ }