소스 검색

Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM

Daniel Supernault 1 년 전
부모
커밋
61d105fd25
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      app/Http/Controllers/DirectMessageController.php

+ 1 - 0
app/Http/Controllers/DirectMessageController.php

@@ -309,6 +309,7 @@ class DirectMessageController extends Controller
 
         $user = $request->user();
         abort_if($user->has_roles && !UserRoleService::can('can-direct-message', $user->id), 403, 'Invalid permissions for this action');
+        abort_if($user->created_at->gt(now()->subHours(72)), 400, 'You need to wait a bit before you can DM another account');
         $profile = $user->profile;
         $recipient = Profile::where('id', '!=', $profile->id)->findOrFail($request->input('to_id'));