mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update AP transformers, fixes #1637
This commit is contained in:
parent
ccaefe3f7f
commit
2c16db187b
2 changed files with 34 additions and 0 deletions
|
@ -22,6 +22,23 @@ class CreateNote extends Fractal\TransformerAbstract
|
||||||
'name' => $name
|
'name' => $name
|
||||||
];
|
];
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
|
if($status->in_reply_to_id != null) {
|
||||||
|
$parent = $status->parent()->profile;
|
||||||
|
if($parent) {
|
||||||
|
$webfinger = $parent->emailUrl();
|
||||||
|
$name = Str::startsWith($webfinger, '@') ?
|
||||||
|
$webfinger :
|
||||||
|
'@' . $webfinger;
|
||||||
|
$reply = [
|
||||||
|
'type' => 'Mention',
|
||||||
|
'href' => $parent->permalink(),
|
||||||
|
'name' => $name
|
||||||
|
];
|
||||||
|
$mentions = array_merge($reply, $mentions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$hashtags = $status->hashtags->map(function ($hashtag) {
|
$hashtags = $status->hashtags->map(function ($hashtag) {
|
||||||
return [
|
return [
|
||||||
'type' => 'Hashtag',
|
'type' => 'Hashtag',
|
||||||
|
|
|
@ -22,6 +22,23 @@ class Note extends Fractal\TransformerAbstract
|
||||||
'name' => $name
|
'name' => $name
|
||||||
];
|
];
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
|
if($status->in_reply_to_id != null) {
|
||||||
|
$parent = $status->parent()->profile;
|
||||||
|
if($parent) {
|
||||||
|
$webfinger = $parent->emailUrl();
|
||||||
|
$name = Str::startsWith($webfinger, '@') ?
|
||||||
|
$webfinger :
|
||||||
|
'@' . $webfinger;
|
||||||
|
$reply = [
|
||||||
|
'type' => 'Mention',
|
||||||
|
'href' => $parent->permalink(),
|
||||||
|
'name' => $name
|
||||||
|
];
|
||||||
|
$mentions = array_merge($reply, $mentions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$hashtags = $status->hashtags->map(function ($hashtag) {
|
$hashtags = $status->hashtags->map(function ($hashtag) {
|
||||||
return [
|
return [
|
||||||
'type' => 'Hashtag',
|
'type' => 'Hashtag',
|
||||||
|
|
Loading…
Reference in a new issue