From 31afaba3d0deeec671ccbbbcdd198992acb3637c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 6 Jun 2023 05:21:44 -0600 Subject: [PATCH] Update ProfilePipeline --- app/Jobs/ProfilePipeline/HandleUpdateActivity.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ProfilePipeline/HandleUpdateActivity.php b/app/Jobs/ProfilePipeline/HandleUpdateActivity.php index ffff068e5..2c5a4456b 100644 --- a/app/Jobs/ProfilePipeline/HandleUpdateActivity.php +++ b/app/Jobs/ProfilePipeline/HandleUpdateActivity.php @@ -11,6 +11,7 @@ use Illuminate\Queue\SerializesModels; use App\Avatar; use App\Profile; use App\Util\ActivityPub\Helpers; +use Cache; use Purify; use App\Jobs\AvatarPipeline\RemoteAvatarFetch; use App\Util\Lexer\Autolink; @@ -81,7 +82,12 @@ class HandleUpdateActivity implements ShouldQueue $profile->save(); } - RemoteAvatarFetch::dispatch($profile)->onQueue('low'); + if(isset($payload['object']['icon'])) { + RemoteAvatarFetch::dispatch($profile)->onQueue('low'); + } else { + $profile->avatar->update(['remote_url' => null]); + Cache::forget('avatar:' . $profile->id); + } return; }