From 6edaf940996e82b42bf62bfca6213803041763c4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 09:36:09 -0700 Subject: [PATCH 1/4] Update AdminController, fix variable name in updateSpam method --- app/Http/Controllers/AdminController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index e492bd1cb..2b3f19916 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -139,8 +139,8 @@ class AdminController extends Controller $appeal->appeal_handled_at = now(); $appeal->save(); - Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $status->profile_id); - Cache::forget('pf:bouncer_v0:recent_by_pid:' . $status->profile_id); + Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $appeal->user->profile_id); + Cache::forget('pf:bouncer_v0:recent_by_pid:' . $appeal->user->profile_id); return redirect('/i/admin/reports/autospam'); } @@ -154,8 +154,8 @@ class AdminController extends Controller $appeal->appeal_handled_at = now(); $appeal->save(); - Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $status->profile_id); - Cache::forget('pf:bouncer_v0:recent_by_pid:' . $status->profile_id); + Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $appeal->user->profile_id); + Cache::forget('pf:bouncer_v0:recent_by_pid:' . $appeal->user->profile_id); return redirect('/i/admin/reports/autospam'); } From 5a116c7ae0b405d9ea5acd6650ef728068d411fc Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 09:37:02 -0700 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e4b9799..747e084cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.10.10...dev) ### Added +### Updated +- Updated AdminController, fix variable name in updateSpam method. ([6edaf940](https://github.com/pixelfed/pixelfed/commit/6edaf940)) + ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10) ### Added From 4f40f6f5a12abe74edacf47c15e786a539418470 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 09:47:02 -0700 Subject: [PATCH 3/4] Update RemotAvatarFetch, only dispatch jobs if cloud storage is enabled --- app/Jobs/AvatarPipeline/RemoteAvatarFetch.php | 4 ++++ app/Util/ActivityPub/Helpers.php | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php b/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php index 6a05949e5..d324a51a4 100644 --- a/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php +++ b/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php @@ -51,6 +51,10 @@ class RemoteAvatarFetch implements ShouldQueue { $profile = $this->profile; + if(config('pixelfed.cloud_storage') !== true) { + return 1; + } + if($profile->domain == null || $profile->private_key) { return 1; } diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index bb3114817..2291b9779 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -474,7 +474,9 @@ class Helpers { $profile->webfinger = strtolower(Purify::clean($webfinger)); $profile->last_fetched_at = now(); $profile->save(); - RemoteAvatarFetch::dispatch($profile); + if(config('pixelfed.cloud_storage') == true) { + RemoteAvatarFetch::dispatch($profile); + } return $profile; }); } else { @@ -488,7 +490,9 @@ class Helpers { $profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null; $profile->save(); } - RemoteAvatarFetch::dispatch($profile); + if(config('pixelfed.cloud_storage') == true) { + RemoteAvatarFetch::dispatch($profile); + } } return $profile; }); From 7d6e42f246bb6d923e3698faa6ca53220e1f924b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 09:47:34 -0700 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 747e084cb..b5184d73a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Updated - Updated AdminController, fix variable name in updateSpam method. ([6edaf940](https://github.com/pixelfed/pixelfed/commit/6edaf940)) +- Updated RemotAvatarFetch, only dispatch jobs if cloud storage is enabled. ([4f40f6f5](https://github.com/pixelfed/pixelfed/commit/4f40f6f5)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)