Assigns values in a single array

This commit is contained in:
Michael 2021-10-07 18:55:49 +00:00
parent 16d7eafd41
commit e61a3d02ce

View file

@ -937,27 +937,28 @@ function statusnet_fetch_contact($uid, $contact, $create_user)
} }
if (!DBA::isResult($contact_record)) { if (!DBA::isResult($contact_record)) {
// create contact record $fields = [
$fields['uid'] = $uid; 'uid' => $uid,
$fields['created'] = DateTimeFormat::utcNow(); 'created' => DateTimeFormat::utcNow(),
$fields['url'] = $contact->statusnet_profile_url; 'url' => $contact->statusnet_profile_url,
$fields['nurl'] = Strings::normaliseLink($contact->statusnet_profile_url); 'nurl' => Strings::normaliseLink($contact->statusnet_profile_url),
$fields['addr'] = statusnet_address($contact); 'addr' => statusnet_address($contact),
$fields['alias'] = Strings::normaliseLink($contact->statusnet_profile_url); 'alias' => Strings::normaliseLink($contact->statusnet_profile_url),
$fields['notify'] = ''; 'notify' => '',
$fields['poll'] = ''; 'poll' => '',
$fields['name'] = $contact->name; 'name' => $contact->name,
$fields['nick'] = $contact->screen_name; 'nick' => $contact->screen_name,
$fields['photo'] = $contact->profile_image_url; 'photo' => $contact->profile_image_url,
$fields['network'] = Protocol::STATUSNET; 'network' => Protocol::STATUSNET,
$fields['rel'] = Contact::FRIEND; 'rel' => Contact::FRIEND,
$fields['priority'] = 1; 'priority' => 1,
$fields['location'] = $contact->location; 'location' => $contact->location,
$fields['about'] = $contact->description; 'about' => $contact->description,
$fields['writable'] = true; 'writable' => true,
$fields['blocked'] = false; 'blocked' => false,
$fields['readonly'] = false; 'readonly' => false,
$fields['pending'] = false; 'pending' => false,
];
if (!Contact::insert($fields)) { if (!Contact::insert($fields)) {
return false; return false;