Merge pull request #7430 from pixelfed/staging

Update StatusService
pull/7439/head v0.14.3
Shlee 1 day ago committed by GitHub
commit ba9033e5ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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']);

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

Loading…
Cancel
Save