Fix delivery counter / archive relay contacts

This commit is contained in:
Michael 2019-09-02 03:25:05 +00:00
parent 3ee26ecd24
commit 6af4c90dff
7 changed files with 111 additions and 31 deletions

View file

@ -906,7 +906,7 @@ class Contact extends BaseObject
// Always unarchive the relay contact entry
if (!empty($contact['batch']) && !empty($contact['term-date']) && ($contact['term-date'] > DBA::NULL_DATETIME)) {
$fields = ['term-date' => DBA::NULL_DATETIME, 'archive' => false];
$condition = ['batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
$condition = ['batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY, 'uid' => 0];
DBA::update('contact', $fields, $condition);
}
@ -1620,7 +1620,7 @@ class Contact extends BaseObject
// Check status of Diaspora endpoints
if (!empty($contact['batch'])) {
return DBA::exists('contact', ['archive' => true, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY]);
return DBA::exists('contact', ['archive' => true, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY, 'uid' => 0]);
}
return false;