]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub.php
Merge remote-tracking branch 'upstream/develop' into failed
[friendica.git] / src / Protocol / ActivityPub.php
index c22bbb333d6a2a5ace2d87a07bc39447f021fc76..2f8c2f419e5d0cc5e87d453b561b7e0016ddc717 100644 (file)
@@ -145,7 +145,7 @@ class ActivityPub
        {
                $apcontact = APContact::getByURL($url, $update);
                if (empty($apcontact)) {
-                       return false;
+                       return [];
                }
 
                $profile = ['network' => Protocol::ACTIVITYPUB];
@@ -170,7 +170,9 @@ class ActivityPub
                $profile['notify'] = $apcontact['inbox'];
                $profile['poll'] = $apcontact['outbox'];
                $profile['pubkey'] = $apcontact['pubkey'];
+               $profile['subscribe'] = $apcontact['subscribe'];
                $profile['baseurl'] = $apcontact['baseurl'];
+               $profile['gsid'] = $apcontact['gsid'];
 
                // Remove all "null" fields
                foreach ($profile as $field => $content) {
@@ -231,13 +233,13 @@ class ActivityPub
                        $items = $data['orderedItems'];
                } elseif (!empty($data['first']['orderedItems'])) {
                        $items = $data['first']['orderedItems'];
-               } elseif (!empty($data['first'])) {
+               } elseif (!empty($data['first']) && is_string($data['first']) && ($data['first'] != $url)) {
                        return self::fetchItems($data['first'], $uid);
                } else {
-                       $items = [];
+                       return [];
                }
 
-               if (!empty($data['next'])) {
+               if (!empty($data['next']) && is_string($data['next'])) {
                        $items = array_merge($items, self::fetchItems($data['next'], $uid));
                }