From cdb6385298d34e8077cabdd460b7eaa8c7575873 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 19 Mar 2020 21:22:02 -0600 Subject: [PATCH] Update v1 Api StatusTransformer --- .../Api/Mastodon/v1/StatusTransformer.php | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php index 6ca61a51..966fc36f 100644 --- a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php +++ b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php @@ -19,33 +19,34 @@ class StatusTransformer extends Fractal\TransformerAbstract { return [ 'id' => (string) $status->id, - 'uri' => $status->url(), - 'url' => $status->url(), + 'created_at' => $status->created_at->toJSON(), 'in_reply_to_id' => $status->in_reply_to_id, 'in_reply_to_account_id' => $status->in_reply_to_profile_id, - 'reblog' => null, - 'content' => $status->rendered ?? $status->caption ?? '', - 'created_at' => $status->created_at->toJSON(), - 'emojis' => [], - 'replies_count' => 0, - 'reblogs_count' => $status->reblogs_count ?? 0, - 'favourites_count' => $status->likes_count ?? 0, - 'reblogged' => null, - 'favourited' => null, - 'muted' => null, 'sensitive' => (bool) $status->is_nsfw, 'spoiler_text' => $status->cw_summary ?? '', 'visibility' => $status->visibility ?? $status->scope, - 'mentions' => [], - 'tags' => [], - 'card' => null, - 'poll' => null, + 'language' => 'en', + 'uri' => $status->url(), + 'url' => $status->url(), + 'replies_count' => 0, + 'reblogs_count' => $status->reblogs_count ?? 0, + 'favourites_count' => $status->likes_count ?? 0, + 'favourited' => false, + 'reblogged' => false, + 'muted' => false, + 'bookmarked' => false, + 'pinned' => false, + 'content' => $status->rendered ?? $status->caption ?? '', + 'reblog' => null, 'application' => [ 'name' => 'web', 'website' => null ], - 'language' => null, - 'pinned' => null, + 'mentions' => [], + 'tags' => [], + 'emojis' => [], + 'card' => null, + 'poll' => null, ]; }