mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM
This commit is contained in:
parent
2d3f1df003
commit
61d105fd25
1 changed files with 1 additions and 0 deletions
|
@ -309,6 +309,7 @@ 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');
|
||||||
|
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'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue