Skip to content

Commit 61d105f

Browse files
committed
Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM
1 parent 2d3f1df commit 61d105f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/Http/Controllers/DirectMessageController.php

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public function create(Request $request)
309309

310310
$user = $request->user();
311311
abort_if($user->has_roles && !UserRoleService::can('can-direct-message', $user->id), 403, 'Invalid permissions for this action');
312+
abort_if($user->created_at->gt(now()->subHours(72)), 400, 'You need to wait a bit before you can DM another account');
312313
$profile = $user->profile;
313314
$recipient = Profile::where('id', '!=', $profile->id)->findOrFail($request->input('to_id'));
314315

0 commit comments

Comments
 (0)