From 7a80216462605e3eb0975e63fdea9117c27684c3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 10 Jan 2019 20:45:19 -0700 Subject: [PATCH] Update InternalApiController --- app/Http/Controllers/InternalApiController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index e2c6b24c..8961b65c 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -54,6 +54,7 @@ class InternalApiController extends Controller $attachments = []; $status = new Status; $mimes = []; + $cw = false; foreach($medias as $k => $media) { $m = Media::findOrFail($media['id']); @@ -64,7 +65,8 @@ class InternalApiController extends Controller $m->license = $media['license']; $m->caption = strip_tags($media['alt']); $m->order = isset($media['cursor']) && is_int($media['cursor']) ? (int) $media['cursor'] : $k; - if($media['cw'] == true) { + if($media['cw'] == true || $profile->cw == true) { + $cw = true; $m->is_nsfw = true; $status->is_nsfw = true; } @@ -84,6 +86,9 @@ class InternalApiController extends Controller $media->save(); } + $visibility = $profile->unlisted == true && $visibility == 'public' ? 'unlisted' : $visibility; + $cw = $profile->cw == true ? true : $cw; + $status->is_nsfw = $cw; $status->visibility = $visibility; $status->scope = $visibility; $status->type = StatusController::mimeTypeCheck($mimes);