Issue 6282: Update the contact data regularly (including the network)

This commit is contained in:
Michael 2019-01-16 21:39:56 +00:00
parent f13b8f8ec4
commit c359c162a7
5 changed files with 87 additions and 74 deletions

View file

@ -634,6 +634,8 @@ class Contact extends BaseObject
Logger::log('Empty contact: ' . json_encode($contact) . ' - ' . System::callstack(20), Logger::DEBUG);
}
Logger::log('Contact '.$contact['id'].' is marked for archival', Logger::DEBUG);
// Contact already archived or "self" contact? => nothing to do
if ($contact['archive'] || $contact['self']) {
return;
@ -682,6 +684,8 @@ class Contact extends BaseObject
return;
}
Logger::log('Contact '.$contact['id'].' is marked as vital again', Logger::DEBUG);
if (!isset($contact['url']) && !empty($contact['id'])) {
$fields = ['id', 'url', 'batch'];
$contact = DBA::selectFirst('contact', [], ['id' => $contact['id']]);
@ -1571,8 +1575,8 @@ class Contact extends BaseObject
$ret = Probe::uri($contact["url"], $network);
// If Probe::uri fails the network code will be different
if (($ret["network"] != $contact["network"]) && !in_array($ret["network"], [Protocol::ACTIVITYPUB, $network])) {
// If Probe::uri fails the network code will be different (mostly "feed" or "unkn")
if (($ret["network"] != $contact["network"]) && !in_array($ret["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, $network])) {
return false;
}