Don't probe anymore, but ensure that we got good contact data

This commit is contained in:
Michael 2018-06-03 08:36:05 +00:00
parent 93fd04e381
commit d7c477d0f4
2 changed files with 36 additions and 36 deletions

View file

@ -944,21 +944,36 @@ class Contact extends BaseObject
'name' => $data['name'],
'nick' => $data['nick']];
// Only fill the pubkey if it was empty before. We have to prevent identity theft.
if (!empty($contact['pubkey'])) {
unset($contact['pubkey']);
} else {
$updated['pubkey'] = $data['pubkey'];
}
if ($data['keywords'] != '') {
$updated['keywords'] = $data['keywords'];
}
if ($data['location'] != '') {
$updated['location'] = $data['location'];
}
if ($data['about'] != '') {
$updated['about'] = $data['about'];
// Update the technical stuff as well - if filled
if ($data['notify'] != '') {
$updated['notify'] = $data['notify'];
}
if ($data['poll'] != '') {
$updated['poll'] = $data['poll'];
}
if ($data['batch'] != '') {
$updated['batch'] = $data['batch'];
}
if ($data['request'] != '') {
$updated['request'] = $data['request'];
}
if ($data['confirm'] != '') {
$updated['confirm'] = $data['confirm'];
}
if ($data['poco'] != '') {
$updated['poco'] = $data['poco'];
}
// Only fill the pubkey if it had been empty before. We have to prevent identity theft.
if (empty($contact['pubkey'])) {
$updated['pubkey'] = $data['pubkey'];
}
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {