mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +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
|
||||
];
|
||||
})->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) {
|
||||
return [
|
||||
'type' => 'Hashtag',
|
||||
|
|
|
@ -22,6 +22,23 @@ class Note extends Fractal\TransformerAbstract
|
|||
'name' => $name
|
||||
];
|
||||
})->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) {
|
||||
return [
|
||||
'type' => 'Hashtag',
|
||||
|
|
Loading…
Reference in a new issue