Update AP transformers, fixes #1637

This commit is contained in:
Daniel Supernault 2019-10-07 03:00:58 -06:00
parent ccaefe3f7f
commit 2c16db187b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 34 additions and 0 deletions

View file

@ -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',

View file

@ -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',