1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-22 07:42:41 +00:00

Merge pull request #5376 from pixelfed/staging

Update DirectMessageController, remove 72h limit for admins
This commit is contained in:
daniel 2024-12-05 22:41:20 -07:00 committed by GitHub
commit f7519b6a79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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