mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
commit
f004b8dcd1
8 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ use League\Fractal\Serializer\ArraySerializer;
|
||||||
|
|
||||||
class StatusService
|
class StatusService
|
||||||
{
|
{
|
||||||
const CACHE_KEY = 'pf:services:status:v1:';
|
const CACHE_KEY = 'pf:services:status:v1.1:';
|
||||||
|
|
||||||
public static function key($id, $publicOnly = true)
|
public static function key($id, $publicOnly = true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
public function transform(Status $status)
|
public function transform(Status $status)
|
||||||
{
|
{
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'@context' => [
|
'@context' => [
|
||||||
|
|
|
@ -52,7 +52,7 @@ class CreateNote extends Fractal\TransformerAbstract
|
||||||
$emojis = CustomEmoji::scan($status->caption, true) ?? [];
|
$emojis = CustomEmoji::scan($status->caption, true) ?? [];
|
||||||
$emoji = array_merge($emojis, $mentions);
|
$emoji = array_merge($emojis, $mentions);
|
||||||
$tags = array_merge($emoji, $hashtags);
|
$tags = array_merge($emoji, $hashtags);
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'@context' => [
|
'@context' => [
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Note extends Fractal\TransformerAbstract
|
||||||
$emojis = CustomEmoji::scan($status->caption, true) ?? [];
|
$emojis = CustomEmoji::scan($status->caption, true) ?? [];
|
||||||
$emoji = array_merge($emojis, $mentions);
|
$emoji = array_merge($emojis, $mentions);
|
||||||
$tags = array_merge($emoji, $hashtags);
|
$tags = array_merge($emoji, $hashtags);
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'@context' => [
|
'@context' => [
|
||||||
|
|
|
@ -53,7 +53,7 @@ class UpdateNote extends Fractal\TransformerAbstract
|
||||||
$emoji = array_merge($emojis, $mentions);
|
$emoji = array_merge($emojis, $mentions);
|
||||||
$tags = array_merge($emoji, $hashtags);
|
$tags = array_merge($emoji, $hashtags);
|
||||||
|
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
$latestEdit = $status->edits()->latest()->first();
|
$latestEdit = $status->edits()->latest()->first();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -13,7 +13,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
public function transform(Status $status)
|
public function transform(Status $status)
|
||||||
{
|
{
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => (string) $status->id,
|
'id' => (string) $status->id,
|
||||||
|
|
|
@ -23,7 +23,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
$taggedPeople = MediaTagService::get($status->id);
|
$taggedPeople = MediaTagService::get($status->id);
|
||||||
$poll = $status->type === 'poll' ? PollService::get($status->id) : null;
|
$poll = $status->type === 'poll' ? PollService::get($status->id) : null;
|
||||||
$rendered = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$rendered = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'_v' => 1,
|
'_v' => 1,
|
||||||
|
|
|
@ -25,7 +25,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
$pid = request()->user()->profile_id;
|
$pid = request()->user()->profile_id;
|
||||||
$taggedPeople = MediaTagService::get($status->id);
|
$taggedPeople = MediaTagService::get($status->id);
|
||||||
$poll = $status->type === 'poll' ? PollService::get($status->id, $pid) : null;
|
$poll = $status->type === 'poll' ? PollService::get($status->id, $pid) : null;
|
||||||
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null;
|
$content = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : "";
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'_v' => 1,
|
'_v' => 1,
|
||||||
|
|
Loading…
Reference in a new issue