Update DM config, allow new users to send DMs by default, with a new env variable to enforce a 72h limit

pull/5862/head
Daniel Supernault 3 months ago
parent 7aed40a3a0
commit 717f17cdee
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -144,7 +144,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');
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');
if ((bool) ! config_cache('instance.allow_new_account_dms')) {
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'));

@ -186,4 +186,6 @@ return [
],
'show_peers' => env('INSTANCE_SHOW_PEERS', false),
'allow_new_account_dms' => env('INSTANCE_ALLOW_NEW_DMS', true),
];

Loading…
Cancel
Save