|
@@ -51,7 +51,7 @@ class RemoteAvatarFetch implements ShouldQueue
|
|
{
|
|
{
|
|
$profile = $this->profile;
|
|
$profile = $this->profile;
|
|
|
|
|
|
- if(config_cache('pixelfed.cloud_storage') !== true) {
|
|
|
|
|
|
+ if(config_cache('pixelfed.cloud_storage') == false && config_cache('federation.avatars.store_local') == false) {
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -59,9 +59,13 @@ class RemoteAvatarFetch implements ShouldQueue
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
- $avatar = Avatar::firstOrCreate([
|
|
|
|
- 'profile_id' => $profile->id
|
|
|
|
- ]);
|
|
|
|
|
|
+ $avatar = Avatar::whereProfileId($profile->id)->first();
|
|
|
|
+
|
|
|
|
+ if(!$avatar) {
|
|
|
|
+ $avatar = new Avatar;
|
|
|
|
+ $avatar->profile_id = $profile->id;
|
|
|
|
+ $avatar->save();
|
|
|
|
+ }
|
|
|
|
|
|
if($avatar->media_path == null && $avatar->remote_url == null) {
|
|
if($avatar->media_path == null && $avatar->remote_url == null) {
|
|
$avatar->media_path = 'public/avatars/default.jpg';
|
|
$avatar->media_path = 'public/avatars/default.jpg';
|
|
@@ -95,7 +99,9 @@ class RemoteAvatarFetch implements ShouldQueue
|
|
$avatar->remote_url = $icon['url'];
|
|
$avatar->remote_url = $icon['url'];
|
|
$avatar->save();
|
|
$avatar->save();
|
|
|
|
|
|
- MediaStorageService::avatar($avatar);
|
|
|
|
|
|
+ if(config_cache('pixelfed.cloud_storage')) {
|
|
|
|
+ MediaStorageService::avatar($avatar);
|
|
|
|
+ }
|
|
|
|
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|