浏览代码

Update DirectMessageController, remove 72h limit for admins

Daniel Supernault 7 月之前
父节点
当前提交
639df41093
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/Http/Controllers/DirectMessageController.php

+ 3 - 1
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'));