Update status model, use scope over deprecated visibility attribute

This commit is contained in:
Daniel Supernault 2020-12-27 18:00:43 -07:00
parent 7225c1f3af
commit f70826e18c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
5 changed files with 8 additions and 8 deletions

View file

@ -1446,7 +1446,7 @@ class ApiV1Controller extends Controller
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
->with('profile', 'hashtags', 'mentions')
->where('id', $dir, $id)
->whereVisibility('public')
->whereScope('public')
->latest()
->limit($limit)
->get();
@ -1473,7 +1473,7 @@ class ApiV1Controller extends Controller
)->whereNull('uri')
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
->with('profile', 'hashtags', 'mentions')
->whereVisibility('public')
->whereScope('public')
->latest()
->simplePaginate($limit);
}

View file

@ -181,14 +181,14 @@ class DiscoverController extends Controller
$ttl = now()->addHours(2);
$res = Cache::remember($key, $ttl, function() use($range) {
if($range == '-1') {
$res = Status::whereVisibility('public')
$res = Status::whereScope('public')
->whereType('photo')
->whereIsNsfw(false)
->orderBy('likes_count','desc')
->take(12)
->get();
} else {
$res = Status::whereVisibility('public')
$res = Status::whereScope('public')
->whereType('photo')
->whereIsNsfw(false)
->orderBy('likes_count','desc')

View file

@ -304,7 +304,7 @@ class PublicApiController extends Controller
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
->whereNotIn('profile_id', $filtered)
->whereLocal(true)
->whereVisibility('public')
->whereScope('public')
->orderBy('created_at', 'desc')
->limit($limit)
->get();
@ -332,7 +332,7 @@ class PublicApiController extends Controller
->whereNotIn('profile_id', $filtered)
->with('profile', 'hashtags', 'mentions')
->whereLocal(true)
->whereVisibility('public')
->whereScope('public')
->orderBy('created_at', 'desc')
->simplePaginate($limit);
}

View file

@ -27,7 +27,7 @@ class ProfileOutbox extends Fractal\TransformerAbstract
$statuses = $profile
->statuses()
->with('media')
->whereVisibility('public')
->whereScope('public')
->orderBy('created_at', 'desc')
->paginate(10);

View file

@ -26,7 +26,7 @@ class Outbox {
$timeline = $profile
->statuses()
->whereVisibility('public')
->whereScope('public')
->orderBy('created_at', 'desc')
->take(10)
->get();