mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-27 10:16:47 +00:00
25 lines
656 B
PHP
25 lines
656 B
PHP
<?php
|
|
|
|
namespace App\Transformer\ActivityPub\Verb;
|
|
|
|
use App\FollowRequest;
|
|
use League\Fractal;
|
|
|
|
class RejectFollow extends Fractal\TransformerAbstract
|
|
{
|
|
public function transform(FollowRequest $follow)
|
|
{
|
|
return [
|
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
|
'type' => 'Reject',
|
|
'id' => $follow->permalink(null, '#rejects'),
|
|
'actor' => $follow->target->permalink(),
|
|
'object' => [
|
|
'type' => 'Follow',
|
|
'id' => $follow->activity && isset($follow->activity['id']) ? $follow->activity['id'] : null,
|
|
'actor' => $follow->actor->permalink(),
|
|
'object' => $follow->target->permalink()
|
|
]
|
|
];
|
|
}
|
|
}
|