Update DirectMessageController, remove 72h limit for admins

This commit is contained in:
Daniel Supernault 2024-12-05 22:36:08 -07:00
parent 8cd01b2ede
commit 639df41093
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -307,7 +307,9 @@ class DirectMessageController extends Controller
$user = $request->user(); $user = $request->user();
abort_if($user->has_roles && ! UserRoleService::can('can-direct-message', $user->id), 403, 'Invalid permissions for this action'); abort_if($user->has_roles && ! UserRoleService::can('can-direct-message', $user->id), 403, 'Invalid permissions for this action');
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'); 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; $profile = $user->profile;
$recipient = Profile::where('id', '!=', $profile->id)->findOrFail($request->input('to_id')); $recipient = Profile::where('id', '!=', $profile->id)->findOrFail($request->input('to_id'));