]> git.mxchange.org Git - friendica.git/commitdiff
Expect outbox->first to be a Link structure in Model\GContact
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 24 Oct 2019 12:47:00 +0000 (08:47 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 24 Oct 2019 12:47:00 +0000 (08:47 -0400)
- See https://www.w3.org/TR/activitystreams-vocabulary/#dfn-first
- Addresses https://github.com/friendica/friendica/issues/7675#issuecomment-545300597

src/Model/GContact.php

index 21225cb23c0addcb7f3c8b9d89e4875e4529ab57..2402d6b519d122e1a09e37dc1bbd7e5ca76dd3b4 100644 (file)
@@ -859,7 +859,9 @@ class GContact
        /**
         * Update a global contact via an ActivityPub Outbox
         *
-        * @param string $data Probing result
+        * @param string $feed
+        * @param array  $data Probing result
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function updateFromOutbox(string $feed, array $data)
        {
@@ -872,6 +874,9 @@ class GContact
                        $items = $outbox['orderedItems'];
                } elseif (!empty($outbox['first']['orderedItems'])) {
                        $items = $outbox['first']['orderedItems'];
+               } elseif (!empty($outbox['first']['href'])) {
+                       self::updateFromOutbox($outbox['first']['href'], $data);
+                       return;
                } elseif (!empty($outbox['first'])) {
                        self::updateFromOutbox($outbox['first'], $data);
                        return;