mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update AnnounceTransformer
This commit is contained in:
parent
ce1d6630d7
commit
f47cd88438
1 changed files with 16 additions and 16 deletions
|
@ -7,20 +7,20 @@ use League\Fractal;
|
||||||
|
|
||||||
class Announce extends Fractal\TransformerAbstract
|
class Announce extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
public function transform(Status $status)
|
public function transform(Status $status)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||||
'id' => $status->permalink(),
|
'id' => $status->permalink(),
|
||||||
'type' => 'Announce',
|
'type' => 'Announce',
|
||||||
'actor' => $status->profile->permalink(),
|
'actor' => $status->profile->permalink(),
|
||||||
'to' => ['https://www.w3.org/ns/activitystreams#Public'],
|
'to' => ['https://www.w3.org/ns/activitystreams#Public'],
|
||||||
'cc' => [
|
'cc' => [
|
||||||
$status->profile->permalink(),
|
$status->profile->permalink(),
|
||||||
$status->profile->follower_url ?? $status->profile->permalink('/followers')
|
$status->profile->follower_url ?? $status->profile->permalink('/followers')
|
||||||
],
|
],
|
||||||
'published' => $status->created_at->format(DATE_ISO8601),
|
'published' => $status->created_at->format(DATE_ISO8601),
|
||||||
'object' => $status->parent()->url(),
|
'object' => $status->parent()->url(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue