mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update DeleteAccountPipeline
This commit is contained in:
parent
9c83451831
commit
fae385989e
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
|||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use DB;
|
||||
use Illuminate\Support\Str;
|
||||
use App\{
|
||||
AccountLog,
|
||||
Activity,
|
||||
|
@ -74,11 +75,15 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
$avatar = $user->profile->avatar;
|
||||
|
||||
if(is_file($avatar->media_path)) {
|
||||
unlink($avatar->media_path);
|
||||
if($avatar->media_path != 'public/avatars/default.png') {
|
||||
unlink($avatar->media_path);
|
||||
}
|
||||
}
|
||||
|
||||
if(is_file($avatar->thumb_path)) {
|
||||
unlink($avatar->thumb_path);
|
||||
if($avatar->thumb_path != 'public/avatars/default.png') {
|
||||
unlink($avatar->thumb_path);
|
||||
}
|
||||
}
|
||||
$avatar->forceDelete();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue