Merge pull request #8901 from annando/failed

New field in gserver, gcontact and contact for failed connections
This commit is contained in:
Hypolite Petovan 2020-07-19 12:21:54 -04:00 committed by GitHub
commit 31d2a74b0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 123 additions and 64 deletions

View file

@ -2415,7 +2415,7 @@ class Item
}
/// @todo On private posts we could obfuscate the date
$update = ($arr['private'] != self::PRIVATE);
$update = ($arr['private'] != self::PRIVATE) || in_array($arr['network'], Protocol::FEDERATED);
// Is it a forum? Then we don't care about the rules from above
if (!$update && in_array($arr["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN]) && ($arr["parent-uri"] === $arr["uri"])) {
@ -2433,15 +2433,15 @@ class Item
} else {
$condition = ['id' => $arr['contact-id'], 'self' => false];
}
DBA::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']], $condition);
DBA::update('contact', ['failed' => false, 'success_update' => $arr['received'], 'last-item' => $arr['received']], $condition);
}
// Now do the same for the system wide contacts with uid=0
if ($arr['private'] != self::PRIVATE) {
DBA::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']],
DBA::update('contact', ['failed' => false, 'success_update' => $arr['received'], 'last-item' => $arr['received']],
['id' => $arr['owner-id']]);
if ($arr['owner-id'] != $arr['author-id']) {
DBA::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']],
DBA::update('contact', ['failed' => false, 'success_update' => $arr['received'], 'last-item' => $arr['received']],
['id' => $arr['author-id']]);
}
}