mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Hide nsfw posts from public/network timelines by default
This commit is contained in:
parent
356ffdb630
commit
3ebae614ce
4 changed files with 9 additions and 2 deletions
|
@ -322,6 +322,7 @@ class PublicApiController extends Controller
|
|||
->whereNull(['in_reply_to_id', 'reblog_of_id'])
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
->whereLocal(true)
|
||||
->where('is_nsfw', false)
|
||||
->whereScope('public')
|
||||
->orderBy('id', 'desc')
|
||||
->limit($limit)
|
||||
|
@ -365,6 +366,7 @@ class PublicApiController extends Controller
|
|||
->whereNull(['in_reply_to_id', 'reblog_of_id'])
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
->whereLocal(true)
|
||||
->where('is_nsfw', false)
|
||||
->whereScope('public')
|
||||
->orderBy('id', 'desc')
|
||||
->limit($limit)
|
||||
|
@ -620,7 +622,8 @@ class PublicApiController extends Controller
|
|||
'scope',
|
||||
'created_at',
|
||||
)
|
||||
->where('id', $dir, $id)
|
||||
->where('id', $dir, $id)
|
||||
->where('is_nsfw', false)
|
||||
->whereNull(['in_reply_to_id', 'reblog_of_id'])
|
||||
->whereNotIn('profile_id', $filtered)
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
|
@ -648,6 +651,7 @@ class PublicApiController extends Controller
|
|||
)
|
||||
->whereNull(['in_reply_to_id', 'reblog_of_id'])
|
||||
->whereNotIn('profile_id', $filtered)
|
||||
->where('is_nsfw', false)
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
->whereNotNull('uri')
|
||||
->whereScope('public')
|
||||
|
|
|
@ -171,7 +171,8 @@ class StatusEntityLexer implements ShouldQueue
|
|||
$status->scope == 'public' &&
|
||||
in_array($status->type, $types) &&
|
||||
$status->in_reply_to_id === null &&
|
||||
$status->reblog_of_id === null
|
||||
$status->reblog_of_id === null &&
|
||||
$status->is_nsfw == false
|
||||
) {
|
||||
PublicTimelineService::add($status->id);
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ class NetworkTimelineService
|
|||
Redis::del(self::CACHE_KEY);
|
||||
$ids = Status::whereNotNull('uri')
|
||||
->whereScope('public')
|
||||
->where('is_nsfw', false)
|
||||
->whereNull('in_reply_to_id')
|
||||
->whereNull('reblog_of_id')
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
|
|
|
@ -78,6 +78,7 @@ class PublicTimelineService {
|
|||
Redis::del(self::CACHE_KEY);
|
||||
$ids = Status::whereNull('uri')
|
||||
->whereNull('in_reply_to_id')
|
||||
->where('is_nsfw', false)
|
||||
->whereNull('reblog_of_id')
|
||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||
->whereScope('public')
|
||||
|
|
Loading…
Reference in a new issue