Merge pull request #4566 from pixelfed/staging

Add Photo reblogs only setting
This commit is contained in:
daniel 2023-07-30 06:35:18 -06:00 committed by GitHub
commit 5cdf076527
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 11 deletions

View file

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

View file

@ -240,9 +240,14 @@ class SettingsController extends Controller
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'));
}
@ -252,7 +257,8 @@ class SettingsController extends Controller
$pid = $request->user()->profile_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);
@ -262,8 +268,10 @@ class SettingsController extends Controller
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();

Binary file not shown.

BIN
public/js/home.chunk.f5594d49a6bead99.js vendored Normal file

Binary file not shown.

BIN
public/js/manifest.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -25,6 +25,12 @@
<p class="text-muted small help-text">See reblogs from accounts you follow in your home feed. (Home timeline only)</p>
</div>
<div class="form-check pb-3">
<input class="form-check-input" type="checkbox" name="photo_reblogs_only" {{$userSettings['photo_reblogs_only'] ? 'checked':''}}>
<label class="form-check-label font-weight-bold" for="">Photo reblogs only</label>
<p class="text-muted small help-text">Only see reblogs of photos or photo albums. (Home timeline only)</p>
</div>
<div class="form-group row mt-5 pt-5">
<div class="col-12 text-right">
<hr>