Update AP transformers, fixes #1637

pull/1770/head
Daniel Supernault 2019-10-07 03:00:58 -06:00
rodzic ccaefe3f7f
commit 2c16db187b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
2 zmienionych plików z 34 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

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