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 e155b0577..83b161401 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -90,6 +90,20 @@ 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 + && request()->has('_pe') + && ! request()->filled('include_reblogs') + && ! empty($res['reblog'])) { + foreach (['account', 'content', 'content_text', 'emojis', 'media_attachments'] as $key) { + if (array_key_exists($key, $res['reblog'])) { + $res[$key] = $res['reblog'][$key]; + } + } + } + return $res; }