]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub.php
Use webfinger in apcontact fetch
[friendica.git] / src / Protocol / ActivityPub.php
index c22bbb333d6a2a5ace2d87a07bc39447f021fc76..5306c27d3c6fb65b7c6737edbf0590e540046e47 100644 (file)
@@ -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));
                }