Changed array name, fixed bug that prevented testing most Diaspora endpoints

This commit is contained in:
Michael Vogel 2019-08-28 16:54:49 +02:00
parent 3c9834922c
commit 96b895bc3a

View file

@ -1570,20 +1570,18 @@ class Contact extends BaseObject
return false; return false;
} }
$archived = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]); $contact = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]);
if (!DBA::isResult($archived)) { if (!DBA::isResult($contact)) {
return false; return false;
} }
if ($archived['archive']) { if ($contact['archive']) {
return true; return true;
} }
$apcontact = APContact::getByURL($archived['url'], false); // Check status of ActivityPub endpoints
if (empty($apcontact)) { $apcontact = APContact::getByURL($contact['url'], false);
return false; if (!empty($apcontact)) {
}
if (!empty($apcontact['inbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['inbox']])) { if (!empty($apcontact['inbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['inbox']])) {
return true; return true;
} }
@ -1591,9 +1589,11 @@ class Contact extends BaseObject
if (!empty($apcontact['sharedinbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['sharedinbox']])) { if (!empty($apcontact['sharedinbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['sharedinbox']])) {
return true; return true;
} }
}
if (!empty($archived['batch'])) { // Check status of Diaspora endpoints
return DBA::exists('contact', ['archive' => true, 'batch' => $archived['batch'], 'contact-type' => self::TYPE_RELAY]); if (!empty($contact['batch'])) {
return DBA::exists('contact', ['archive' => true, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY]);
} }
return false; return false;