From 7dee8f58fe04df141a40651f148a213523e186be Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 4 Sep 2021 01:55:29 -0600 Subject: [PATCH 1/3] Update StoryComposeController, fix expiry bug --- app/Http/Controllers/StoryComposeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/StoryComposeController.php b/app/Http/Controllers/StoryComposeController.php index b510c3f78..9e2ed17cd 100644 --- a/app/Http/Controllers/StoryComposeController.php +++ b/app/Http/Controllers/StoryComposeController.php @@ -68,6 +68,7 @@ class StoryComposeController extends Controller $story->local = true; $story->size = $photo->getSize(); $story->bearcap_token = str_random(64); + $story->expires_at = now()->addMinutes(1440); $story->save(); $url = $story->path; @@ -179,7 +180,6 @@ class StoryComposeController extends Controller ->findOrFail($id); $story->active = true; - $story->expires_at = now()->addMinutes(1440); $story->duration = $request->input('duration', 10); $story->can_reply = $request->input('can_reply'); $story->can_react = $request->input('can_react'); From 84382c8aa9e619427d1c29f7f6a0300084ecba7e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 4 Sep 2021 01:56:08 -0600 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a692e1015..5d5c5a76f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -104,6 +104,7 @@ - Updated snowflake id generation to improve randomness. ([e5aea490](https://github.com/pixelfed/pixelfed/commit/e5aea490)) - Updated Timeline, remove recent posts. ([7641b731](https://github.com/pixelfed/pixelfed/commit/7641b731)) - Updated InstanceCrawlPipeline, remove unused variable. ([e73cf531](https://github.com/pixelfed/pixelfed/commit/e73cf531)) +- Updated StoryComposeController, fix expiry bug. ([7dee8f58](https://github.com/pixelfed/pixelfed/commit/7dee8f58)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) From d32d05eed0662502d3ecb73d5159fd2c50ebad34 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 4 Sep 2021 01:59:50 -0600 Subject: [PATCH 3/3] Update story gc --- app/Console/Commands/StoryGC.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/StoryGC.php b/app/Console/Commands/StoryGC.php index 8dd0aefce..1645ad885 100644 --- a/app/Console/Commands/StoryGC.php +++ b/app/Console/Commands/StoryGC.php @@ -51,7 +51,7 @@ class StoryGC extends Command protected function archiveExpiredStories() { $stories = Story::whereActive(true) - ->where('expires_at', '<', now()) + ->where('created_at', '<', now()->subHours(24)) ->get(); foreach($stories as $story) {