mirror of
https://github.com/friendica/friendica
synced 2025-04-23 12:30:10 +00:00
Move sending follow message to remote server to Protocol class
This commit is contained in:
parent
8c8c6fe720
commit
84e7f65d52
3 changed files with 64 additions and 53 deletions
|
@ -40,8 +40,14 @@ class Follow extends BaseApi
|
|||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
$cid = Contact::follow($this->parameters['id'], $uid);
|
||||
$contact = Contact::getById($this->parameters['id'], ['url']);
|
||||
|
||||
System::jsonExit(DI::mstdnRelationship()->createFromContactId($cid, $uid)->toArray());
|
||||
$result = Contact::createFromProbeForUser($uid, $contact['url']);
|
||||
|
||||
if (!$result['success']) {
|
||||
DI::mstdnError()->UnprocessableEntity($result['message']);
|
||||
}
|
||||
|
||||
System::jsonExit(DI::mstdnRelationship()->createFromContactId($result['cid'], $uid)->toArray());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue