mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Update PublicApiController
This commit is contained in:
parent
718d9a0452
commit
dbaf903d68
1 changed files with 5 additions and 5 deletions
|
@ -110,7 +110,7 @@ class PublicApiController extends Controller
|
|||
]);
|
||||
$limit = $request->limit ?? 10;
|
||||
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
|
||||
$status = Status::whereProfileId($profile->id)->findOrFail($postId);
|
||||
$status = Status::whereProfileId($profile->id)->whereCommentsDisabled(false)->findOrFail($postId);
|
||||
$this->scopeCheck($profile, $status);
|
||||
if($request->filled('min_id') || $request->filled('max_id')) {
|
||||
if($request->filled('min_id')) {
|
||||
|
@ -578,9 +578,9 @@ class PublicApiController extends Controller
|
|||
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
||||
return $following->push($pid)->toArray();
|
||||
});
|
||||
$visibility = true == in_array($profile->id, $following) ? ['public', 'unlisted', 'private'] : ['public'];
|
||||
$visibility = true == in_array($profile->id, $following) ? ['public', 'unlisted', 'private'] : ['public', 'unlisted'];
|
||||
} else {
|
||||
$visibility = ['public'];
|
||||
$visibility = ['public', 'unlisted'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,8 +606,8 @@ class PublicApiController extends Controller
|
|||
->whereLocal(true)
|
||||
->whereNull('uri')
|
||||
->where('id', $dir, $id)
|
||||
->whereIn('visibility',$visibility)
|
||||
->orderBy('created_at', 'desc')
|
||||
->whereIn('visibility', $visibility)
|
||||
->latest()
|
||||
->limit($limit)
|
||||
->get();
|
||||
|
||||
|
|
Loading…
Reference in a new issue