More often update Diaspora contacts

This commit is contained in:
Michael 2021-12-30 22:40:52 +00:00
parent 3d9be965a6
commit ce174cad91
2 changed files with 11 additions and 2 deletions

View file

@ -1241,6 +1241,10 @@ class Contact
Logger::info('Contact will be updated', ['url' => $url, 'uid' => $uid, 'update' => $update, 'cid' => $contact_id]); Logger::info('Contact will be updated', ['url' => $url, 'uid' => $uid, 'update' => $update, 'cid' => $contact_id]);
} }
if ($data['network'] == Protocol::DIASPORA) {
FContact::updateFromProbeArray($data);
}
self::updateFromProbeArray($contact_id, $data); self::updateFromProbeArray($contact_id, $data);
// Don't return a number for a deleted account // Don't return a number for a deleted account
@ -2076,6 +2080,11 @@ class Contact
} }
$ret = Probe::uri($contact['url'], $network, $contact['uid']); $ret = Probe::uri($contact['url'], $network, $contact['uid']);
if ($ret['network'] == Protocol::DIASPORA) {
FContact::updateFromProbeArray($ret);
}
return self::updateFromProbeArray($id, $ret); return self::updateFromProbeArray($id, $ret);
} }

View file

@ -75,7 +75,7 @@ class FContact
// Note that Friendica contacts will return a "Diaspora person" // Note that Friendica contacts will return a "Diaspora person"
// if Diaspora connectivity is enabled on their server // if Diaspora connectivity is enabled on their server
if ($data['network'] ?? '' === Protocol::DIASPORA) { if ($data['network'] ?? '' === Protocol::DIASPORA) {
self::updateFContact($data); self::updateFromProbeArray($data);
$person = self::getByURL($handle, false); $person = self::getByURL($handle, false);
} }
@ -90,7 +90,7 @@ class FContact
* @param array $arr The fcontact data * @param array $arr The fcontact data
* @throws \Exception * @throws \Exception
*/ */
private static function updateFContact($arr) public static function updateFromProbeArray($arr)
{ {
$uriid = ItemURI::insert(['uri' => $arr['url'], 'guid' => $arr['guid']]); $uriid = ItemURI::insert(['uri' => $arr['url'], 'guid' => $arr['guid']]);