profile = $profile; $this->url = $url; } /** * Execute the job. * * @return void */ public function handle() { $profile = $this->profile; Cache::forget('avatar:'.$profile->id); AccountService::del($profile->id); if ((bool) config_cache('pixelfed.cloud_storage') == false && (bool) config_cache('federation.avatars.store_local') == false) { return 1; } if ($profile->domain == null || $profile->private_key) { return 1; } $avatar = Avatar::whereProfileId($profile->id)->first(); if (! $avatar) { $avatar = new Avatar; $avatar->profile_id = $profile->id; $avatar->is_remote = true; $avatar->remote_url = $this->url; $avatar->save(); } else { $avatar->remote_url = $this->url; $avatar->is_remote = true; $avatar->save(); } MediaStorageService::avatar($avatar, (bool) config_cache('pixelfed.cloud_storage') == false, true); return 1; } }