Update ProfilePipeline

This commit is contained in:
Daniel Supernault 2023-06-06 05:21:44 -06:00
parent 0eb51ed74d
commit 31afaba3d0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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;
}