Render boosts in clients that only read the top level

pull/7419/head
Lily Cohen 2 days ago
parent c002e6d466
commit 92dfdeda11

@ -2786,7 +2786,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']);
@ -2857,7 +2858,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']);

@ -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;
}

Loading…
Cancel
Save