瀏覽代碼

Update CommentController, fix scope bug

Daniel Supernault 5 年之前
父節點
當前提交
45ecad2a07
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/Http/Controllers/CommentController.php

+ 3 - 0
app/Http/Controllers/CommentController.php

@@ -61,6 +61,7 @@ class CommentController extends Controller
         }
 
         $reply = DB::transaction(function() use($comment, $status, $profile) {
+            $scope = $profile->is_private == true ? 'private' : 'public';
             $autolink = Autolink::create()->autolink($comment);
             $reply = new Status();
             $reply->profile_id = $profile->id;
@@ -68,6 +69,8 @@ class CommentController extends Controller
             $reply->rendered = $autolink;
             $reply->in_reply_to_id = $status->id;
             $reply->in_reply_to_profile_id = $status->profile_id;
+            $reply->scope = $scope;
+            $reply->visibility = $scope;
             $reply->save();
 
             $status->reply_count++;