mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update StatusTransformer, remove unused fields
This commit is contained in:
parent
0d350ea03e
commit
9b82f75183
1 changed files with 3 additions and 17 deletions
|
@ -10,9 +10,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
{
|
||||
protected $defaultIncludes = [
|
||||
'account',
|
||||
'mentions',
|
||||
'media_attachments',
|
||||
'tags',
|
||||
];
|
||||
|
||||
public function transform(Status $status)
|
||||
|
@ -41,13 +39,15 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
],
|
||||
'language' => null,
|
||||
'pinned' => null,
|
||||
|
||||
'mentions' => [],
|
||||
'tags' => [],
|
||||
'pf_type' => $status->type ?? $status->setType(),
|
||||
'reply_count' => (int) $status->reply_count,
|
||||
'comments_disabled' => $status->comments_disabled ? true : false,
|
||||
'thread' => false,
|
||||
'replies' => [],
|
||||
'parent' => [],
|
||||
//'place' => $status->place
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,6 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
return $this->item($account, new AccountTransformer());
|
||||
}
|
||||
|
||||
public function includeMentions(Status $status)
|
||||
{
|
||||
$mentions = $status->mentions;
|
||||
|
||||
return $this->collection($mentions, new MentionTransformer());
|
||||
}
|
||||
|
||||
public function includeMediaAttachments(Status $status)
|
||||
{
|
||||
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addDays(14), function() use($status) {
|
||||
|
@ -74,11 +67,4 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function includeTags(Status $status)
|
||||
{
|
||||
$tags = $status->hashtags;
|
||||
|
||||
return $this->collection($tags, new HashtagTransformer());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue