Simplified the Contact update

This commit is contained in:
Michael 2019-07-04 21:19:23 +00:00
parent c9666a9f1d
commit be0a102333
2 changed files with 22 additions and 62 deletions

View file

@ -1468,10 +1468,12 @@ class Contact extends BaseObject
'url' => $data['url'],
'nurl' => Strings::normaliseLink($data['url']),
'name' => $data['name'],
'nick' => $data['nick'],
'baseurl' => $data['baseurl']
'nick' => $data['nick']
];
if (!empty($data['baseurl'])) {
$updated['baseurl'] = $data['baseurl'];
}
if (!empty($data['keywords'])) {
$updated['keywords'] = $data['keywords'];
}
@ -1500,7 +1502,7 @@ class Contact extends BaseObject
}
// Only fill the pubkey if it had been empty before. We have to prevent identity theft.
if (empty($contact['pubkey'])) {
if (empty($contact['pubkey']) && !empty($data['pubkey'])) {
$updated['pubkey'] = $data['pubkey'];
}