diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index acf41df44..834dbc24f 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -34,9 +34,11 @@ class CommentController extends Controller $this->validate($request, [ 'item' => 'required|integer|min:1', 'comment' => 'required|string|max:'.(int) config('pixelfed.max_caption_length'), + 'sensitive' => 'nullable|boolean' ]); $comment = $request->input('comment'); - $statusId = $request->item; + $statusId = $request->input('item'); + $nsfw = $request->input('sensitive', false); $user = Auth::user(); $profile = $user->profile; @@ -56,11 +58,12 @@ class CommentController extends Controller return; } - $reply = DB::transaction(function() use($comment, $status, $profile) { + $reply = DB::transaction(function() use($comment, $status, $profile, $nsfw) { $scope = $profile->is_private == true ? 'private' : 'public'; $autolink = Autolink::create()->autolink($comment); $reply = new Status(); $reply->profile_id = $profile->id; + $reply->is_nsfw = $nsfw; $reply->caption = e($comment); $reply->rendered = $autolink; $reply->in_reply_to_id = $status->id; diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 9c8eea1be..b3e834ede 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -3,10 +3,10 @@
-
+

You are blocking this account

-

Click here to view this status

+

View Status

@@ -257,7 +257,7 @@
-
+
@@ -301,16 +301,24 @@
- -
+
-

- {{status.content_text}} +

+

+

+ by {{statusUsername}} + + + Follow + +

+

+ avatar +
+
+
+

+ {{status.content_text.length ? status.content_text : 'Untitled Post'}}

by {{statusUsername}} @@ -318,7 +326,7 @@ Follow -->

- avatar + avatar

@@ -330,7 +338,7 @@ {{timeAgo(status.created_at)}} ago

- - Hide + Hide Report - Mute Profile - Block Profile + Mute Profile + Block Profile - Delete + Delete