mirror of
https://github.com/friendica/friendica
synced 2024-11-14 03:42:53 +00:00
Change FollowRequest return type to be Account
This commit is contained in:
parent
637b6f5a17
commit
31b746cb16
1 changed files with 4 additions and 3 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Factory\Api\Mastodon;
|
||||||
|
|
||||||
use Friendica\App\BaseURL;
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseFactory;
|
use Friendica\BaseFactory;
|
||||||
|
use Friendica\Collection\Api\Mastodon\Fields;
|
||||||
use Friendica\Contact\Introduction\Entity\Introduction;
|
use Friendica\Contact\Introduction\Entity\Introduction;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\APContact;
|
use Friendica\Model\APContact;
|
||||||
|
@ -45,10 +46,10 @@ class FollowRequest extends BaseFactory
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Introduction $introduction
|
* @param Introduction $introduction
|
||||||
* @return \Friendica\Object\Api\Mastodon\FollowRequest
|
* @return \Friendica\Object\Api\Mastodon\Account
|
||||||
* @throws ImagickException|HTTPException\InternalServerErrorException
|
* @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]]);
|
$account = DBA::selectFirst('account-user-view', [], ['id' => $introduction->cid, 'uid' => [0, $introduction->uid]]);
|
||||||
if (empty($account)) {
|
if (empty($account)) {
|
||||||
|
@ -56,6 +57,6 @@ class FollowRequest extends BaseFactory
|
||||||
throw new HTTPException\InternalServerErrorException('Wrong introduction data');
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue