mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +00:00
Update AP Note transformers, add location/place
This commit is contained in:
parent
880a3db9b7
commit
92b6204c66
3 changed files with 23 additions and 2 deletions
|
@ -54,6 +54,13 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
];
|
||||
}),
|
||||
'tag' => [],
|
||||
'location' => $status->place_id ? [
|
||||
'type' => 'Place',
|
||||
'name' => $status->place->name,
|
||||
'longitude' => $status->place->long,
|
||||
'lattitude' => $status->place->lat,
|
||||
'country' => $status->place->country
|
||||
] : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,14 @@ class CreateNote extends Fractal\TransformerAbstract
|
|||
'announce' => 'https://www.w3.org/ns/activitystreams#Public',
|
||||
'like' => 'https://www.w3.org/ns/activitystreams#Public',
|
||||
'reply' => $status->comments_disabled == true ? null : 'https://www.w3.org/ns/activitystreams#Public'
|
||||
]
|
||||
],
|
||||
'location' => $status->place_id ? [
|
||||
'type' => 'Place',
|
||||
'name' => $status->place->name,
|
||||
'longitude' => $status->place->long,
|
||||
'lattitude' => $status->place->lat,
|
||||
'country' => $status->place->country
|
||||
] : null,
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -67,7 +67,14 @@ class Note extends Fractal\TransformerAbstract
|
|||
'announce' => 'https://www.w3.org/ns/activitystreams#Public',
|
||||
'like' => 'https://www.w3.org/ns/activitystreams#Public',
|
||||
'reply' => $status->comments_disabled == true ? null : 'https://www.w3.org/ns/activitystreams#Public'
|
||||
]
|
||||
],
|
||||
'location' => $status->place_id ? [
|
||||
'type' => 'Place',
|
||||
'name' => $status->place->name,
|
||||
'longitude' => $status->place->long,
|
||||
'lattitude' => $status->place->lat,
|
||||
'country' => $status->place->country
|
||||
] : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue