mirror of
https://github.com/friendica/friendica
synced 2025-04-26 22:30:18 +00:00
Support for fetching non-public content / preparations for forum posts
This commit is contained in:
parent
1395bdc188
commit
8f27e3aeb1
5 changed files with 188 additions and 30 deletions
|
@ -7,6 +7,7 @@ namespace Friendica\Protocol;
|
|||
use Friendica\Util\Network;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Model\APContact;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
|
||||
/**
|
||||
* @brief ActivityPub Protocol class
|
||||
|
@ -59,11 +60,16 @@ class ActivityPub
|
|||
/**
|
||||
* Fetches ActivityPub content from the given url
|
||||
*
|
||||
* @param string $url content url
|
||||
* @param string $url content url
|
||||
* @param integer $uid User ID for the signature
|
||||
* @return array
|
||||
*/
|
||||
public static function fetchContent($url)
|
||||
public static function fetchContent($url, $uid = 0)
|
||||
{
|
||||
if (!empty($uid)) {
|
||||
return HTTPSignature::fetch($url, 1);
|
||||
}
|
||||
|
||||
$curlResult = Network::curl($url, false, $redirects, ['accept_content' => 'application/activity+json, application/ld+json']);
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue