From 639df41093a9865d0413af77c70015ab96d02b94 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 5 Dec 2024 22:36:08 -0700 Subject: [PATCH] Update DirectMessageController, remove 72h limit for admins --- app/Http/Controllers/DirectMessageController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DirectMessageController.php b/app/Http/Controllers/DirectMessageController.php index 3f8d61036..b2e0df3a2 100644 --- a/app/Http/Controllers/DirectMessageController.php +++ b/app/Http/Controllers/DirectMessageController.php @@ -307,7 +307,9 @@ 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'); + if (! $user->is_admin) { + 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'));