X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2FContact.php;h=8b575bf122bfba5f8c8cc887e01eeeca65600823;hb=9f2196aa1aa0dc112e3fc238832828d4e22fe137;hp=a0b9ec5e94e5b0c851ecf0b0fec164218e2c31e2;hpb=5d0e7d24babf345431df73472fc0d1c7c80996f9;p=friendica.git diff --git a/include/Contact.php b/include/Contact.php index a0b9ec5e94..8b575bf122 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -607,6 +607,10 @@ function get_contact($url, $uid = 0, $no_update = false) { $data = array_merge($data, $gcontacts); } + if (!$contact_id && ($data["alias"] != '') && ($data["alias"] != $url)) { + $contact_id = get_contact($data["alias"], $uid, true); + } + $url = $data["url"]; if (!$contact_id) { dba::insert('contact', array('uid' => $uid, 'created' => datetime_convert(), 'url' => $data["url"], @@ -658,7 +662,7 @@ function get_contact($url, $uid = 0, $no_update = false) { update_contact_avatar($data["photo"], $uid, $contact_id); - $contact = dba::select('contact', array('addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date'), + $contact = dba::select('contact', array('url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date'), array('id' => $contact_id), array('limit' => 1)); // This condition should always be true @@ -668,6 +672,8 @@ function get_contact($url, $uid = 0, $no_update = false) { $updated = array('addr' => $data['addr'], 'alias' => $data['alias'], + 'url' => $data['url'], + 'nurl' => normalise_link($data['url']), 'name' => $data['name'], 'nick' => $data['nick']);