diff --git a/app/Transformer/ActivityPub/StatusTransformer.php b/app/Transformer/ActivityPub/StatusTransformer.php index e89a57fa5..8ef1142b9 100644 --- a/app/Transformer/ActivityPub/StatusTransformer.php +++ b/app/Transformer/ActivityPub/StatusTransformer.php @@ -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, ]; } } diff --git a/app/Transformer/ActivityPub/Verb/CreateNote.php b/app/Transformer/ActivityPub/Verb/CreateNote.php index b5f51d769..7127f0dc1 100644 --- a/app/Transformer/ActivityPub/Verb/CreateNote.php +++ b/app/Transformer/ActivityPub/Verb/CreateNote.php @@ -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, ] ]; } diff --git a/app/Transformer/ActivityPub/Verb/Note.php b/app/Transformer/ActivityPub/Verb/Note.php index ac4567179..aef532b38 100644 --- a/app/Transformer/ActivityPub/Verb/Note.php +++ b/app/Transformer/ActivityPub/Verb/Note.php @@ -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, ]; } }