Rename Api\Mastodon\Account::createFromContact to just create

- Retrieve public contact in Api\Mastodon\FollowRequests instead of user contact
This commit is contained in:
Hypolite Petovan 2019-12-25 05:41:35 -05:00
parent 9ed8479b32
commit cb7875b035
4 changed files with 15 additions and 10 deletions

View file

@ -87,9 +87,14 @@ class FollowRequests extends Api
$return = [];
foreach ($intros as $intro) {
$contact = Contact::getById($intro['contact-id']);
$apcontact = APContact::getByURL($contact['url'], false);
$account = Mastodon\Account::createFromContact($contact, $apcontact);
$cdata = Contact::getPublicAndUserContacID($intro['contact-id'], $intro['uid']);
if (empty($cdata['public'])) {
continue;
}
$publicContact = Contact::getById($cdata['public']);
$apcontact = APContact::getByURL($publicContact['url'], false);
$account = Mastodon\Account::create($publicContact, $apcontact);
// Not ideal, the same "account" can have multiple ids depending on the context
$account->id = $intro['id'];

View file

@ -13,7 +13,7 @@ class Instance extends Api
{
/**
* @param array $parameters
* @throws HTTPException\InternalServerErrorException
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function rawContent(array $parameters = [])
{