1
0
Fork 0
forked from mirror/pixelfed

Update StatusTransformer

This commit is contained in:
Daniel Supernault 2023-10-20 00:17:24 -06:00
parent dfe2379b93
commit 65a048cdd5
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
3 changed files with 8 additions and 2 deletions

View file

@ -24,7 +24,9 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
{
$taggedPeople = MediaTagService::get($status->id);
$poll = $status->type === 'poll' ? PollService::get($status->id) : null;
$rendered = $status->caption ? Autolink::create()->autolink($status->caption) : null;
$rendered = config('exp.autolink') ?
( $status->caption ? Autolink::create()->autolink($status->caption) : '' ) :
( $status->rendered ?? $status->caption );
return [
'_v' => 1,

View file

@ -28,7 +28,9 @@ class StatusTransformer extends Fractal\TransformerAbstract
$pid = request()->user()->profile_id;
$taggedPeople = MediaTagService::get($status->id);
$poll = $status->type === 'poll' ? PollService::get($status->id, $pid) : null;
$rendered = $status->caption ? Autolink::create()->autolink($status->caption) : null;
$rendered = config('exp.autolink') ?
( $status->caption ? Autolink::create()->autolink($status->caption) : '' ) :
( $status->rendered ?? $status->caption );
return [
'_v' => 1,

View file

@ -41,4 +41,6 @@ return [
// Post Update/Edits
'pue' => env('EXP_PUE', true),
'autolink' => env('EXP_AUTOLINK_V2', false),
];