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

This commit is contained in:
Daniel Supernault 2024-05-07 04:21:20 -06:00
parent 2d3f1df003
commit 61d105fd25
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1
1 changed files with 1 additions and 0 deletions

View File

@ -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'));