diff --git a/CHANGELOG.md b/CHANGELOG.md index 595c5a452..9fe7c3f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - Update StatusStatelessTransformer, allow unlisted reblogs ([1c13b518](https://github.com/pixelfed/pixelfed/commit/1c13b518)) - Update ApiV1Controller, hydrate reblog state in home timeline ([13bdaa2e](https://github.com/pixelfed/pixelfed/commit/13bdaa2e)) - Update Timeline component, improve reblog support ([29de91e5](https://github.com/pixelfed/pixelfed/commit/29de91e5)) +- Update timeline settings, add photo reblogs only option ([e2705b9a](https://github.com/pixelfed/pixelfed/commit/e2705b9a)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 75142305b..2eb9df65f 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -231,43 +231,51 @@ class SettingsController extends Controller public function timelineSettings(Request $request) { $uid = $request->user()->id; - $pid = $request->user()->profile_id; - $top = Redis::zscore('pf:tl:top', $pid) != false; - $replies = Redis::zscore('pf:tl:replies', $pid) != false; + $pid = $request->user()->profile_id; + $top = Redis::zscore('pf:tl:top', $pid) != false; + $replies = Redis::zscore('pf:tl:replies', $pid) != false; $userSettings = UserSetting::firstOrCreate([ 'user_id' => $uid ]); if(!$userSettings || !$userSettings->other) { $userSettings = [ 'enable_reblogs' => false, + 'photo_reblogs_only' => false ]; } else { - $userSettings = $userSettings->other; + $userSettings = array_merge([ + 'enable_reblogs' => false, + 'photo_reblogs_only' => false + ], + $userSettings->other); } - return view('settings.timeline', compact('top', 'replies', 'userSettings')); + return view('settings.timeline', compact('top', 'replies', 'userSettings')); } public function updateTimelineSettings(Request $request) { $pid = $request->user()->profile_id; - $uid = $request->user()->id; + $uid = $request->user()->id; $this->validate($request, [ - 'enable_reblogs' => 'sometimes' + 'enable_reblogs' => 'sometimes', + 'photo_reblogs_only' => 'sometimes' ]); - Redis::zrem('pf:tl:top', $pid); - Redis::zrem('pf:tl:replies', $pid); + Redis::zrem('pf:tl:top', $pid); + Redis::zrem('pf:tl:replies', $pid); $userSettings = UserSetting::firstOrCreate([ 'user_id' => $uid ]); - if($userSettings->other) { + if($userSettings->other) { $other = $userSettings->other; $other['enable_reblogs'] = $request->has('enable_reblogs'); + $other['photo_reblogs_only'] = $request->has('photo_reblogs_only'); } else { $other['enable_reblogs'] = $request->has('enable_reblogs'); + $other['photo_reblogs_only'] = $request->has('photo_reblogs_only'); } $userSettings->other = $other; $userSettings->save(); - return redirect(route('settings'))->with('status', 'Timeline settings successfully updated!'); + return redirect(route('settings'))->with('status', 'Timeline settings successfully updated!'); } public function mediaSettings(Request $request) diff --git a/public/js/home.chunk.e9ae8285416aa78f.js b/public/js/home.chunk.e9ae8285416aa78f.js deleted file mode 100644 index 3aabb058b..000000000 Binary files a/public/js/home.chunk.e9ae8285416aa78f.js and /dev/null differ diff --git a/public/js/home.chunk.f5594d49a6bead99.js b/public/js/home.chunk.f5594d49a6bead99.js new file mode 100644 index 000000000..069bafbc1 Binary files /dev/null and b/public/js/home.chunk.f5594d49a6bead99.js differ diff --git a/public/js/home.chunk.e9ae8285416aa78f.js.LICENSE.txt b/public/js/home.chunk.f5594d49a6bead99.js.LICENSE.txt similarity index 100% rename from public/js/home.chunk.e9ae8285416aa78f.js.LICENSE.txt rename to public/js/home.chunk.f5594d49a6bead99.js.LICENSE.txt diff --git a/public/js/manifest.js b/public/js/manifest.js index 3776ff4be..06d6f3be7 100644 Binary files a/public/js/manifest.js and b/public/js/manifest.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index b1553a1e1..a32ba4648 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/views/settings/timeline.blade.php b/resources/views/settings/timeline.blade.php index 4bd075146..e65af8370 100644 --- a/resources/views/settings/timeline.blade.php +++ b/resources/views/settings/timeline.blade.php @@ -25,6 +25,12 @@
See reblogs from accounts you follow in your home feed. (Home timeline only)
+Only see reblogs of photos or photo albums. (Home timeline only)
+