mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +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;
|
$limit = $request->limit ?? 10;
|
||||||
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
|
$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);
|
$this->scopeCheck($profile, $status);
|
||||||
if($request->filled('min_id') || $request->filled('max_id')) {
|
if($request->filled('min_id') || $request->filled('max_id')) {
|
||||||
if($request->filled('min_id')) {
|
if($request->filled('min_id')) {
|
||||||
|
@ -578,9 +578,9 @@ class PublicApiController extends Controller
|
||||||
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
||||||
return $following->push($pid)->toArray();
|
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 {
|
} else {
|
||||||
$visibility = ['public'];
|
$visibility = ['public', 'unlisted'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,8 +606,8 @@ class PublicApiController extends Controller
|
||||||
->whereLocal(true)
|
->whereLocal(true)
|
||||||
->whereNull('uri')
|
->whereNull('uri')
|
||||||
->where('id', $dir, $id)
|
->where('id', $dir, $id)
|
||||||
->whereIn('visibility',$visibility)
|
->whereIn('visibility', $visibility)
|
||||||
->orderBy('created_at', 'desc')
|
->latest()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue