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

pull/5080/head
Daniel Supernault 2024-05-07 04:21:20 -06:00
rodzic 2d3f1df003
commit 61d105fd25
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

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