Browse Source

Update CommentPipeline

Daniel Supernault 3 years ago
parent
commit
1515a9f111

+ 1 - 1
app/Http/Controllers/PublicApiController.php

@@ -691,7 +691,7 @@ class PublicApiController extends Controller
 
 
     public function accountFollowing(Request $request, $id)
     public function accountFollowing(Request $request, $id)
     {
     {
-    	abort_if(!$request->user(), 403);
+		abort_if(!$request->user(), 403);
 		$account = AccountService::get($id);
 		$account = AccountService::get($id);
 		abort_if(!$account, 404);
 		abort_if(!$account, 404);
 		$pid = $request->user()->profile_id;
 		$pid = $request->user()->profile_id;

+ 9 - 0
app/Jobs/CommentPipeline/CommentPipeline.php

@@ -93,5 +93,14 @@ class CommentPipeline implements ShouldQueue
             NotificationService::set($notification->profile_id, $notification->id);
             NotificationService::set($notification->profile_id, $notification->id);
             StatusService::del($comment->id);
             StatusService::del($comment->id);
         });
         });
+
+        if($exists = Cache::get('status:replies:all:' . $status->id)) {
+        	if($exists && $exists->count() == 3) {
+        	} else {
+        		Cache::forget('status:replies:all:' . $status->id);
+        	}
+        } else {
+        	Cache::forget('status:replies:all:' . $status->id);
+        }
     }
     }
 }
 }