Bläddra i källkod

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

Daniel Supernault 1 år sedan
förälder
incheckning
61d105fd25
1 ändrade filer med 1 tillägg och 0 borttagningar
  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'));