$profiledata["about"] = "";
}
- $profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user()));
+ $profiledata = Contact::getByURLForUser($profiledata["url"], local_user()) ?: $profiledata;
if (!empty($profiledata["photo"])) {
$profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]);
'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
];
- $contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user()));
+ $contact_details = Contact::getByURLForUser($rr["url"], local_user()) ?: $rr;
$entry = [
'url' => Contact::magicLink($rr['url']),
return $resultList;
}
- $data = DBA::select('gcontact', ['nurl'], [
+ $data = DBA::select('gcontact', ['nurl', 'name', 'addr', 'url', 'photo', 'network', 'keywords'], [
'NOT `hide`
AND `network` IN (?, ?, ?, ?)
AND ((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`))
continue;
}
- $contact = Contact::getByURLForUser($row["nurl"], local_user());
+ $contact = Contact::getByURLForUser($row["nurl"], local_user()) ?: $row;
if ($contact["name"] == "") {
$contact["name"] = end(explode("/", $urlParts["path"]));
$contact["url"],
$contact["photo"],
$contact["network"],
- $contact["cid"],
- $contact["zid"],
+ $contact["cid"] ?? 0,
+ $contact["zid"] ?? 0,
$contact["keywords"]
);
$entries = [];
foreach ($friends as $friend) {
//get further details of the contact
- $contactDetails = array_merge($friend, Model\Contact::getByURLForUser($friend['url'], $uid));
+ $contactDetails = Model\Contact::getByURLForUser($friend['url'], $uid) ?: $friend;
$connlnk = '';
// $friend[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photoMenu
continue;
}
- $contact_details = array_merge($contact, Contact::getByURLForUser($contact['url'], $a->profile['uid']));
+ $contact_details = Contact::getByURLForUser($contact['url'], $a->profile['uid']) ?: $contact;
$contacts[] = [
'id' => $contact['id'],
if ($isAddr) {
$contact = Contact::selectFirst(['id'], ['addr' => $search, 'uid' => 0]);
} else {
- $contact = array_merge(['id' => 0], Contact::getByURL($search, null, ['id']));
+ $contact = Contact::getByURL($search, null, ['id']) ?: ['id' => 0];
}
if (DBA::isResult($contact)) {