Update existing contact records with data from probing

This commit is contained in:
Michael 2017-07-12 06:07:22 +00:00
parent a47e1e13d7
commit 69f20959ff
1 changed files with 11 additions and 1 deletions

View File

@ -625,7 +625,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', 'avatar-date'),
$contact = dba::select('contact', array('addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date'),
array('id' => $contact_id), array('limit' => 1));
// This condition should always be true
@ -638,6 +638,16 @@ function get_contact($url, $uid = 0, $no_update = false) {
'name' => $data['name'],
'nick' => $data['nick']);
if ($data['keywords'] != '') {
$updated['keywords'] = $data['keywords'];
}
if ($data['location'] != '') {
$updated['location'] = $data['location'];
}
if ($data['about'] != '') {
$updated['about'] = $data['about'];
}
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
$updated['uri-date'] = datetime_convert();
}