From 43d3aa2b94616ffed151b141951c8a206641d52e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 8 May 2023 22:49:08 -0600 Subject: [PATCH] Update StatusTransformers, fix ProfileService to soft fail on missing or deleted accounts --- app/Transformer/Api/Mastodon/v1/StatusTransformer.php | 2 +- app/Transformer/Api/StatusTransformer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php index 3467654af..bfbc3d58b 100644 --- a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php +++ b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php @@ -42,7 +42,7 @@ class StatusTransformer extends Fractal\TransformerAbstract 'card' => null, 'poll' => null, 'media_attachments' => MediaService::get($status->id), - 'account' => ProfileService::get($status->profile_id), + 'account' => ProfileService::get($status->profile_id, true), 'tags' => StatusHashtagService::statusTags($status->id), ]; } diff --git a/app/Transformer/Api/StatusTransformer.php b/app/Transformer/Api/StatusTransformer.php index c44257f81..61c5f875b 100644 --- a/app/Transformer/Api/StatusTransformer.php +++ b/app/Transformer/Api/StatusTransformer.php @@ -66,7 +66,7 @@ class StatusTransformer extends Fractal\TransformerAbstract 'label' => StatusLabelService::get($status), 'liked_by' => LikeService::likedBy($status), 'media_attachments' => MediaService::get($status->id), - 'account' => ProfileService::get($status->profile_id), + 'account' => ProfileService::get($status->profile_id, true), 'tags' => StatusHashtagService::statusTags($status->id), 'poll' => $poll, 'bookmarked' => BookmarkService::get($pid, $status->id),