]> git.mxchange.org Git - friendica.git/commitdiff
Changed array name, fixed bug that prevented testing most Diaspora endpoints
authorMichael Vogel <icarus@dabo.de>
Wed, 28 Aug 2019 14:54:49 +0000 (16:54 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 28 Aug 2019 14:54:49 +0000 (16:54 +0200)
src/Model/Contact.php

index 0bde409fa053707ebe6a8bb028a07ada0bfcc08c..6887b9d0a40c949641c5f33315ee989697f0c181 100644 (file)
@@ -1570,30 +1570,30 @@ class Contact extends BaseObject
                        return false;
                }
 
-               $archived = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]);
-               if (!DBA::isResult($archived)) {
+               $contact = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]);
+               if (!DBA::isResult($contact)) {
                        return false;
                }
 
-               if ($archived['archive']) {
+               if ($contact['archive']) {
                        return true;
                }
 
-               $apcontact = APContact::getByURL($archived['url'], false);
-               if (empty($apcontact)) {
-                       return false;
-               }
-
-               if (!empty($apcontact['inbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['inbox']])) {
-                       return true;
-               }
+               // Check status of ActivityPub endpoints
+               $apcontact = APContact::getByURL($contact['url'], false);
+               if (!empty($apcontact)) {
+                       if (!empty($apcontact['inbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['inbox']])) {
+                               return true;
+                       }
 
-               if (!empty($apcontact['sharedinbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['sharedinbox']])) {
-                       return true;
+                       if (!empty($apcontact['sharedinbox']) && DBA::exists('inbox-status', ['archive' => true, 'url' => $apcontact['sharedinbox']])) {
+                               return true;
+                       }
                }
 
-               if (!empty($archived['batch'])) {
-                       return DBA::exists('contact', ['archive' => true, 'batch' => $archived['batch'], 'contact-type' => self::TYPE_RELAY]);
+               // Check status of Diaspora endpoints
+               if (!empty($contact['batch'])) {
+                       return DBA::exists('contact', ['archive' => true, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY]);
                 }
 
                return false;