Asynchronous contact relation check

This commit is contained in:
Michael 2020-07-29 15:39:45 +00:00
parent dca1fa06bf
commit 4fbec33af0
3 changed files with 115 additions and 45 deletions

View file

@ -2075,7 +2075,7 @@ class Contact
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function updateFromProbe($id, $network = '', $force = false)
public static function updateFromProbe(int $id, string $network = '', bool $force = false)
{
/*
Warning: Never ever fetch the public key via Probe::uri and write it into the contacts.
@ -2123,6 +2123,10 @@ class Contact
return false;
}
if (ContactRelation::isDiscoverable($ret['url'])) {
Worker::add(PRIORITY_LOW, 'ContactDiscovery', $ret['url']);
}
if (isset($ret['hide']) && is_bool($ret['hide'])) {
$ret['unsearchable'] = $ret['hide'];
}
@ -2147,8 +2151,6 @@ class Contact
GContact::updateFromPublicContactID($id);
}
ContactRelation::discoverByUrl($ret['url']);
$update = false;
// make sure to not overwrite existing values with blank entries except some technical fields