Bladeren bron

Merge pull request #5080 from pixelfed/staging

Staging
daniel 1 jaar geleden
bovenliggende
commit
ab383ba55b

+ 6 - 2
CHANGELOG.md

@@ -1,7 +1,11 @@
 # Release Notes
 # Release Notes
 
 
-## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.12.0...dev)
--  ([](https://github.com/pixelfed/pixelfed/commit/))
+## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.12.1...dev)
+
+### Updates
+- Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM ([61d105fd](https://github.com/pixelfed/pixelfed/commit/61d105fd))
+- Update AdminCuratedRegisterController, increase message length from 1000 to 3000 ([9a5e3471](https://github.com/pixelfed/pixelfed/commit/))
+-  ([](https://github.com/pixelfed/pixelfed/commit/9a5e3471))
 
 
 ## [v0.12.1 (2024-05-07)](https://github.com/pixelfed/pixelfed/compare/v0.12.0...v0.12.1)
 ## [v0.12.1 (2024-05-07)](https://github.com/pixelfed/pixelfed/compare/v0.12.0...v0.12.1)
 
 

+ 1 - 1
app/Http/Controllers/AdminCuratedRegisterController.php

@@ -174,7 +174,7 @@ class AdminCuratedRegisterController extends Controller
     public function apiMessageSendStore(Request $request, $id)
     public function apiMessageSendStore(Request $request, $id)
     {
     {
         $this->validate($request, [
         $this->validate($request, [
-            'message' => 'required|string|min:5|max:1000',
+            'message' => 'required|string|min:5|max:3000',
         ]);
         ]);
         $record = CuratedRegister::findOrFail($id);
         $record = CuratedRegister::findOrFail($id);
         abort_if($record->email_verified_at === null, 400, 'Cannot message an unverified email');
         abort_if($record->email_verified_at === null, 400, 'Cannot message an unverified email');

+ 1 - 0
app/Http/Controllers/DirectMessageController.php

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