Update AP Note transformers, add location/place

This commit is contained in:
Daniel Supernault 2019-09-05 18:27:05 -06:00
parent 880a3db9b7
commit 92b6204c66
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
3 changed files with 23 additions and 2 deletions

View file

@ -54,6 +54,13 @@ class StatusTransformer extends Fractal\TransformerAbstract
]; ];
}), }),
'tag' => [], 'tag' => [],
'location' => $status->place_id ? [
'type' => 'Place',
'name' => $status->place->name,
'longitude' => $status->place->long,
'lattitude' => $status->place->lat,
'country' => $status->place->country
] : null,
]; ];
} }
} }

View file

@ -74,7 +74,14 @@ class CreateNote extends Fractal\TransformerAbstract
'announce' => 'https://www.w3.org/ns/activitystreams#Public', 'announce' => 'https://www.w3.org/ns/activitystreams#Public',
'like' => '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' '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,
] ]
]; ];
} }

View file

@ -67,7 +67,14 @@ class Note extends Fractal\TransformerAbstract
'announce' => 'https://www.w3.org/ns/activitystreams#Public', 'announce' => 'https://www.w3.org/ns/activitystreams#Public',
'like' => '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' '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,
]; ];
} }
} }