X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOutbox.php;h=6e095b730671d3d18f8ce91123b0b4931b72e13f;hb=15caf4b3f7eacda399a56b1ad8eeb9d3257306d9;hp=681d1cccb103d76ccd1b225758e67f442a115f3b;hpb=a97b540ebb3f1d5bb5c18b4c0fb631443d03b5a7;p=friendica.git diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 681d1cccb1..6e095b7306 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -1,36 +1,55 @@ . + * */ + namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Protocol\ActivityPub; -use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\User; +use Friendica\Protocol\ActivityPub; +use Friendica\Util\HTTPSignature; /** * ActivityPub Outbox */ class Outbox extends BaseModule { - public static function rawContent() + public static function rawContent(array $parameters = []) { - $a = self::getApp(); + $a = DI::app(); + // @TODO: Replace with parameter from router if (empty($a->argv[1])) { - System::httpExit(404); + throw new \Friendica\Network\HTTPException\NotFoundException(); } $owner = User::getOwnerDataByNick($a->argv[1]); if (empty($owner)) { - System::httpExit(404); + throw new \Friendica\Network\HTTPException\NotFoundException(); } - $page = defaults($_REQUEST, 'page', null); - - $outbox = ActivityPub\Transmitter::getOutbox($owner, $page); + $page = $_REQUEST['page'] ?? null; + $requester = HTTPSignature::getSigner('', $_SERVER); + $outbox = ActivityPub\Transmitter::getOutbox($owner, $page, $requester); header('Content-Type: application/activity+json'); echo json_encode($outbox); exit();