From d43682148397cfad4c9bdc2bdada44ed41ab3c97 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 22 Sep 2026 02:16:49 -0600 Subject: [PATCH] Update StatusService --- app/Http/Controllers/Api/ApiV1Controller.php | 6 ++++-- app/Services/StatusService.php | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 6c670f6a0..100028459 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2796,7 +2796,8 @@ class ApiV1Controller extends Controller return false; } - $status['account'] = $account; + // Not $status['account'] = $account: $account is resolved from + // the row, StatusService picks the right one per client if ($pid) { $status['favourited'] = (bool) LikeService::liked($pid, $s['id']); @@ -2874,7 +2875,8 @@ class ApiV1Controller extends Controller return false; } - $status['account'] = $account; + // Not $status['account'] = $account: $account is resolved from + // the row, StatusService picks the right one per client if ($pid) { $status['favourited'] = (bool) LikeService::liked($pid, $s['id']); diff --git a/app/Services/StatusService.php b/app/Services/StatusService.php index c419ad4ef..1f2735b5c 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -90,14 +90,16 @@ class StatusService unset($res['_pid']); } - // A client that resolves reblogs declares include_reblogs; one that - // only reads the top level renders a boost as an empty card, so give it - // the shared status there instead. - if (! $mastodonMode + // Legacy _pe clients that don't resolve `reblog` would render a boost + // as an empty card, so lift the shared content up. Never touch + // `account`: the top-level account is always the booster. + if ( + ! $mastodonMode && request()->has('_pe') && ! request()->filled('include_reblogs') - && ! empty($res['reblog'])) { - foreach (['account', 'content', 'content_text', 'emojis', 'media_attachments'] as $key) { + && ! empty($res['reblog']) + ) { + foreach (['content', 'content_text', 'emojis', 'media_attachments'] as $key) { if (array_key_exists($key, $res['reblog'])) { $res[$key] = $res['reblog'][$key]; }