forked from mirror/pixelfed
Update Status Model
This commit is contained in:
parent
6f3695e6de
commit
7691da69a9
1 changed files with 8 additions and 6 deletions
|
@ -113,7 +113,7 @@ class Status extends Model
|
||||||
public function bookmarked()
|
public function bookmarked()
|
||||||
{
|
{
|
||||||
if (!Auth::check()) {
|
if (!Auth::check()) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
$profile = Auth::user()->profile;
|
$profile = Auth::user()->profile;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class Status extends Model
|
||||||
{
|
{
|
||||||
$parent = $this->in_reply_to_id ?? $this->reblog_of_id;
|
$parent = $this->in_reply_to_id ?? $this->reblog_of_id;
|
||||||
if (!empty($parent)) {
|
if (!empty($parent)) {
|
||||||
return self::findOrFail($parent);
|
return $this->findOrFail($parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ class Status extends Model
|
||||||
'url' => $media->url(),
|
'url' => $media->url(),
|
||||||
'name' => null
|
'name' => null
|
||||||
];
|
];
|
||||||
})
|
})->toArray()
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -268,14 +268,16 @@ class Status extends Model
|
||||||
$res['to'] = [];
|
$res['to'] = [];
|
||||||
$res['cc'] = [];
|
$res['cc'] = [];
|
||||||
$scope = $this->scope;
|
$scope = $this->scope;
|
||||||
|
$mentions = $this->mentions->map(function ($mention) {
|
||||||
|
return $mention->permalink();
|
||||||
|
})->toArray();
|
||||||
|
|
||||||
switch ($scope) {
|
switch ($scope) {
|
||||||
case 'public':
|
case 'public':
|
||||||
$res['to'] = [
|
$res['to'] = [
|
||||||
"https://www.w3.org/ns/activitystreams#Public"
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
];
|
];
|
||||||
$res['cc'] = [
|
$res['cc'] = array_merge([$this->profile->permalink('/followers')], $mentions);
|
||||||
$this->profile->permalink('/followers')
|
|
||||||
];
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue