diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 2d4a71bdd..98fb9d33e 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -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') diff --git a/app/Jobs/StatusPipeline/StatusEntityLexer.php b/app/Jobs/StatusPipeline/StatusEntityLexer.php index 6762e76e4..9732226c4 100644 --- a/app/Jobs/StatusPipeline/StatusEntityLexer.php +++ b/app/Jobs/StatusPipeline/StatusEntityLexer.php @@ -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); } diff --git a/app/Services/NetworkTimelineService.php b/app/Services/NetworkTimelineService.php index 959019b9a..3a5397784 100644 --- a/app/Services/NetworkTimelineService.php +++ b/app/Services/NetworkTimelineService.php @@ -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']) diff --git a/app/Services/PublicTimelineService.php b/app/Services/PublicTimelineService.php index 35382b050..4e95842e4 100644 --- a/app/Services/PublicTimelineService.php +++ b/app/Services/PublicTimelineService.php @@ -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')