]> git.mxchange.org Git - friendica.git/commitdiff
Change FollowRequest return type to be Account
authorHank Grabowski <hankgrabowski@gmail.com>
Wed, 15 Feb 2023 20:40:10 +0000 (15:40 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Wed, 15 Feb 2023 20:40:10 +0000 (15:40 -0500)
src/Factory/Api/Mastodon/FollowRequest.php

index 2b12b1dbd4d8d0480eac2bb659fdd25b34f510cc..fcb2c9df8c5ba51246156994526047bac20c533a 100644 (file)
@@ -23,6 +23,7 @@ namespace Friendica\Factory\Api\Mastodon;
 
 use Friendica\App\BaseURL;
 use Friendica\BaseFactory;
+use Friendica\Collection\Api\Mastodon\Fields;
 use Friendica\Contact\Introduction\Entity\Introduction;
 use Friendica\Database\DBA;
 use Friendica\Model\APContact;
@@ -45,10 +46,10 @@ class FollowRequest extends BaseFactory
 
        /**
         * @param Introduction $introduction
-        * @return \Friendica\Object\Api\Mastodon\FollowRequest
+        * @return \Friendica\Object\Api\Mastodon\Account
         * @throws ImagickException|HTTPException\InternalServerErrorException
         */
-       public function createFromIntroduction(Introduction $introduction): \Friendica\Object\Api\Mastodon\FollowRequest
+       public function createFromIntroduction(Introduction $introduction): \Friendica\Object\Api\Mastodon\Account
        {
                $account = DBA::selectFirst('account-user-view', [], ['id' => $introduction->cid, 'uid' => [0, $introduction->uid]]);
                if (empty($account)) {
@@ -56,6 +57,6 @@ class FollowRequest extends BaseFactory
                        throw new HTTPException\InternalServerErrorException('Wrong introduction data');
                }
 
-               return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $account);
+               return new \Friendica\Object\Api\Mastodon\Account($this->baseUrl, $account, new Fields());
        }
 }